Commit Graph

800 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
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
Peter von der Ahé 935af1e77f Use unique package paths in incremental_load_from_dill_test.dart
Change-Id: I94cb9ddffa604bdb682af0da0df4810b7523954d
Reviewed-on: https://dart-review.googlesource.com/c/78462
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-08 10:09:25 +00:00
Dan Rubel 358b580941 more fasta parser tests
Change-Id: I41f45835ca36fc5752ae537e67dce55299493e43
Reviewed-on: https://dart-review.googlesource.com/c/78260
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-10-05 15:36:41 +00:00
Dan Rubel b6a8e31492 Improve error message when var is used as a type name
... and Address comments in
https://dart-review.googlesource.com/c/sdk/+/78101

Change-Id: I8b3bc9888185d9802a389baa3f197f9b29927b7f
Reviewed-on: https://dart-review.googlesource.com/c/78103
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-05 11:56:26 +00:00
Dan Rubel 1472053545 Add fasta regress test for 34563
Change-Id: Ic5971e44e1853215f8e841d589ea9ef12bdef179
Reviewed-on: https://dart-review.googlesource.com/c/78100
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-10-05 10:39:21 +00:00
Aske Simon Christensen eacf720d2b Functions to demangle mixin application class names
Demangle all names in messages to avoid printing mangled names in
user-facing output.

Point messages about implicit mixin application classes at the subclass
name for consistency with named mixin application classes.

Change-Id: I90973986c422f271af99e18b3deb5847adf4d430
Reviewed-on: https://dart-review.googlesource.com/c/77380
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-10-03 14:56:43 +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
Peter von der Ahé 440b9c61a7 Handle duplicated declaration used as prefix.
Fixes https://github.com/dart-lang/sdk/issues/34645

Change-Id: I24842b6146c1e3b38ae0b6561ae0e1bec63db2a9
Reviewed-on: https://dart-review.googlesource.com/c/77802
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-10-03 09:57:14 +00:00
Peter von der Ahé 097e8d86b8 Use context severity when calling onProblem
Change-Id: Id1aef8c9185e4d1e660cc342d54a12923a890a43
Reviewed-on: https://dart-review.googlesource.com/77060
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-10-02 17:02:10 +00:00
Peter von der Ahé 002a3e090d Improve error message on unresolved constructor redirections
Change-Id: Ifd3975becaeeb312a5c3ca12228828ea49a00d2b
Reviewed-on: https://dart-review.googlesource.com/76942
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-10-02 17:02:10 +00:00
Peter von der Ahé a1ebe68359 Change how compile-time NSM is handled
Change-Id: I8dc408c1ffec9307e776288a8fb99604c7dedd6b
Reviewed-on: https://dart-review.googlesource.com/76664
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-10-02 16:53:03 +00:00
Peter von der Ahé df32b2ae49 Ignore synthetic tokens when compiling bodies
Change-Id: Id5f6c4158e70f5a444a6baec1374da20f961a4ec
Reviewed-on: https://dart-review.googlesource.com/76603
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-10-02 13:59:20 +00:00
Peter von der Ahé f3047f1b9c Improve diagnostics with constructor names
Change-Id: I4065ca11064b7569c869f9ea665c85fd287432ce
Reviewed-on: https://dart-review.googlesource.com/76602
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-10-02 13:59:20 +00:00
Peter von der Ahé 3f1955a97b Improve diagnostics about duplication in enums
Change-Id: I20f8ab79a8dbe6f2604f64cc26c2a91f46fcd2c2
Reviewed-on: https://dart-review.googlesource.com/76600
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-09-28 12:36:55 +00:00
Peter von der Ahé 8ef3258e59 Remove _ConstantExpressionError
Change-Id: I0f7c590e826d9516d7b916cb6e39fd67eab97997
Reviewed-on: https://dart-review.googlesource.com/76662
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-09-28 08:41:53 +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
Daniel Hillerström 98a9adf696 Make constructor function types conform with the specification.
Prior to this CL the return type of any constructor function was
always void. According to the specification §9.3 the return type of a
constructor function ought to be its enclosing class.

Change-Id: I70d76cc354b7f118ce96bf4954daf7fe535eb7be
Reviewed-on: https://dart-review.googlesource.com/76160
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-09-26 09:39:11 +00:00
Peter von der Ahé ab305f2f26 Recover from duplicated declarations
Before, a duplciated declaration would cause the compiler to abort using
deprecated_InputError.

Change-Id: Ide8d13802045e9a349f0f408a6d174a47c7f6418
Reviewed-on: https://dart-review.googlesource.com/76122
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-09-25 14:53:58 +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
Alexander Markov 53497549ab [vm] Specialize 'new List()' on kernel AST
In VM, 'new List' is equivalent to either 'new _GrowableList' or
'new _List' depending on the number of arguments.
This change does the transformation early (on kernel AST), in order
to have specialized representation in TFA and in bytecode.

Change-Id: I46f0db8cc19efb3a53fdbe971ac26bdd2736fbda
Reviewed-on: https://dart-review.googlesource.com/76283
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-25 00:38:57 +00:00
Peter von der Ahé 309d38f300 Consistency in messages about duplication
Change-Id: I2d29c4f08d55d97453cc44344036c54e70e8a155
Reviewed-on: https://dart-review.googlesource.com/75900
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-09-24 13:47:17 +00:00
Alexander Aprelev c688d0c0c3 [frontend] When serializing compiled expression proc, clone type params first.
If there are circular references between type parameters and types in the bounds,
currently serialization leaves original type parameters unchanged, which results
in failures to serialize compiled expression procedure.

This CL makes sure to clone all type parameters first, then passes map
with old-to-new type parameters to CloneVisitor.

Bug: https://github.com/dart-lang/sdk/issues/34052
Change-Id: Idf3e6e6e9099f93cdd7e970ab3b21921cdb29178
Reviewed-on: https://dart-review.googlesource.com/75241
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-09-20 14:55:59 +00:00
Peter von der Ahé 9e86c1a395 Normalize strong.status
Change-Id: Id15fe6d2f8e045e31bc2fb4264267197ea129b23
Reviewed-on: https://dart-review.googlesource.com/74840
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-09-19 09:11:19 +00:00
Peter von der Ahé 3831da8743 Include all problems in expectations
Change-Id: Ib9426243ae851bdf529f11d0d9b47c75679972fa
Reviewed-on: https://dart-review.googlesource.com/74760
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-09-19 08:34:43 +00:00
Vyacheslav Egorov f8a3d802d0 Revert "[vm/kernel] Preserve strong mode types in async transformation"
This reverts commit eec96f9076.

Revert "[vm/kernel] In async transformation check if strongMode is on."

This reverts commit 348ed30efd.

Reason for revert: getStaticType is unreliable in Kernel

R=alexmarkov@google.com

Change-Id: I08b914f947a00923491bb610ed74d6348882554f
Reviewed-on: https://dart-review.googlesource.com/75220
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-09-17 22:58:55 +00:00
Vyacheslav Egorov 348ed30efd [vm/kernel] In async transformation check if strongMode is on.
It seems we are still using non-strong mode targets in few
places (e.g. when training front-end server we by accident
train it in legacy mode).

A separate bug is filed to clean that up https://github.com/dart-lang/sdk/issues/34468

For now to unbreak the build we simply check if we are in the
legacy mode and then avoid using getStaticType in async
transformation.

This is followup to eec96f9076.

Bug: https://github.com/dart-lang/sdk/issues/34463
Change-Id: Ib693fddfb9abbf89599ae646cb408d4a9c93f1b6
Reviewed-on: https://dart-review.googlesource.com/75061
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-14 22:11:30 +00:00
Vyacheslav Egorov eec96f9076 [vm/kernel] Preserve strong mode types in async transformation
Async transformation uses dynamic variables in few places (e.g.
for temporaries and for incomming arguments) - which creates
not strongly typed AST with method invocations having dynamic
receivers and non-null interface targets at the same time.

To maintain strong typedness of the AST we insert unsafeCast
when accessing the temporaries.

Bug: https://github.com/dart-lang/sdk/issues/34463
Change-Id: I11e38c128645ebc8acb0c982a80fe4c5c4036673
Reviewed-on: https://dart-review.googlesource.com/75000
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-14 17:19:29 +00:00
Peter von der Ahé 56c2ed5e9e Avoid deprecation in source_loader
Change-Id: Idf3250bd8fcc56f7d52e3f245671d2c1b91d0956
Reviewed-on: https://dart-review.googlesource.com/63144
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-09-13 08:10:15 +00:00
Jens Johansen 5bcc80439f Fasta: Don't crash on on raw generic type cycles
...in type variable bounds with typedefs.

This is the Fasta fix for #33479.

Change-Id: Id3c45891364d390a37424efbcfdb4254bb2f8c48
Reviewed-on: https://dart-review.googlesource.com/73860
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-09-12 12:37:02 +00:00
Peter von der Ahé 00ceb8e359 Share type handling between BodyBuilder and OutlineBuilder.
The BodyBuilder now operates on TypeBuilders instead of DartType.

This

* enables better error messages, and

* paves the way for removing the dependency on OutlineBuilder from BodyBuilder.

Change-Id: I2fb5e61a4d30c11f01d04cc0150d5352b4fb6999
Reviewed-on: https://dart-review.googlesource.com/74064
Reviewed-by: Jens Johansen <jensj@google.com>
2018-09-11 12:44:46 +00:00
Peter von der Ahé b62eef3d8b Use LocatedMessage for invalid types
Change-Id: Ib233b40211d1893b1de6bea36e84c91c81a49fa9
Reviewed-on: https://dart-review.googlesource.com/73343
Reviewed-by: Jens Johansen <jensj@google.com>
2018-09-06 10:25:15 +00:00
Peter von der Ahé 2782266d5c Unify QualifiedName and Identifier
Change-Id: Ie7e7131c58186efd5ed4e81e2f010cc240ce8d03
Reviewed-on: https://dart-review.googlesource.com/73341
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-09-06 08:57:07 +00:00
Konstantin Shcheglov 239bd1383b Report MEMBER_WITH_CLASS_NAME for static getter/setter with the enclosing class name.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34289
Change-Id: I8b593b4a652547e54ed06c80e34e82c11a14d7e8
Reviewed-on: https://dart-review.googlesource.com/73241
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-05 18:11:00 +00:00
Jens Johansen 4cbe28035d Better context message on SyntheticForwarder in MissingImplementation
Previously we could get something like this:
```
regress_32660_test_06.dart:9:7: Context: 'foo' is defined here.
class I extends G implements H {
      ^^^
```

because a SyntheticForwarder was added with a file location of the
class.

It now instead goes to the forwarding stub target and says
```
regress_32660_test_06.dart:6:3: Context: 'foo' is defined here.
  foo(int x, {int y}) => y;
  ^^^
```

Change-Id: I6fb1b958f58635c9afffa8e58cd49eb69df28afd
Reviewed-on: https://dart-review.googlesource.com/72680
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-09-05 14:05:33 +00:00
Jens Johansen 49ca2fcaf9 Detect cycles in type variable bounds
Fixes #32989.

Change-Id: I809d67a4c0cbbb24446ace6fd56bb3b1a4c1364a
Reviewed-on: https://dart-review.googlesource.com/73120
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-09-05 13:16:46 +00:00
Jens Johansen 416ef3fc4e Setter with name of class is error
Fixes #34225.

Change-Id: I1efd39ad1739f49a60d724ca13d916623b9fff09
Reviewed-on: https://dart-review.googlesource.com/72841
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-09-05 13:00:20 +00:00
Peter von der Ahé 2667a3e123 Regression test for issue 34291
See https://github.com/dart-lang/sdk/issues/34291

Change-Id: I3a3d621efac939a8005707283c1d7105c7d4d8b4
Reviewed-on: https://dart-review.googlesource.com/73140
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-09-05 12:40:45 +00:00
Kevin Millikin 9bdf2489b5 Signal errors and warnings for invalid returns
Implement the feature spec for checking returns against inferred
function return types:

https://github.com/dart-lang/sdk/blob/master/docs/language/informal/invalid_returns.md

with the change that an invalid return without a subexpression is
a warning, not an error.  This is because it is a warning in the
analyzer and it would be a breaking change to turn it into an
error.

The check for valid returns is moved to exactly where we handle
returns, rather than in ensureAssignable which is used as a
helper in a lot of places. A bug in type inference was fixed: we
would use `void` for the type of return without a subexpression
instead of `null`.  To accommodate that we would use a
non-standard subtyping relation for returns.  This could lead to
us inferring a return type of `void` in cases where we should
not.

Change-Id: Iee9ece9c722f47efa305f49490d3022d0bbb9f44
Reviewed-on: https://dart-review.googlesource.com/72403
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-09-04 16:50:51 +00:00
Jens Johansen 015840d31f Fasta: Wrong number of type parameters is an error
E.g. `new Map<String>` is now reported as an error.

Note that this does not add a check for whether correct types are given,
so e.g.

```
class Foo<X extends num> {}
main() {
  new Foo<String>();
}
```

is not caught by this fix.

Fixes #32972, #32281.

Change-Id: I57513b5c13865a828890775c8e14f7433d00bdbe
Reviewed-on: https://dart-review.googlesource.com/72382
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-09-04 10:10:32 +00:00
Peter von der Ahé 23dd0cccb2 Remove OutlineListener.
Revert "Store named types resolution during outline building."

This reverts commit 82947cccc9.

Revert "Store reference/type for invalid types."

This reverts commit 9fb6c09015.

Revert "Clear ShadowX references that are not required after compilation."

This reverts commit 6c39bc38f3.

Revert "Store constructor field initializera when the target is not a field."

This reverts commit 12326c10e1.

Revert "Don't rewrite error Severity for special cases of front-end testing."

This reverts commit 4bb3fb6cae.

Revert "Translate ConstructorElement(s) of parameterized InterfaceType(s) to ConstructorMember(s)."

This reverts commit 62a2752b96.

Revert "Store resolution for out of range integer literals."

This reverts commit 8df84c0a00.

Revert "Infer original expression in SyntheticExpressionJudgment."

This reverts commit cec29e4aa8.

Revert "Resolve invalid 'as' constant expression."

This reverts commit 77202bf2b0.

Revert "Resolve invalid return from constructor."

This reverts commit 737e546939.

Revert "Store import prefix offset into metadata and resynthesize."

This reverts commit c30af508a4.

Revert "Get documentation comments before metadata as well."

This reverts commit 29401573d5.

Revert "Put fileEndOffset into ArgumentsJudgment and use to report argument errors."

This reverts commit d69a354026.

Revert "Return SourceSpan with actual length from _CompilationMessage."

This reverts commit ac973e5ba7.

Revert "Store codeOffset / codeLength for classes."

This reverts commit 28583df3ee.

Revert "Store and resynthesize codeOffset/codeLength for functions and methods."

This reverts commit 5a2a13c8bf.

Revert "Fix analyzer/FE integration of invalid assignments to classes."

This reverts commit a814614cf4.

Revert "Fix analyzer/FE integration of assignments to non-l-values."

This reverts commit d10204f3a0.

Revert "Fix analyzer/FE integration of assignments to ambiguous types."

This reverts commit e87efdffb4.

Revert "Fix analyzer/FE integration of assignments to ambiguous types."

This reverts commit 1b5d273fd7.

Revert "Fix analyzer/FE integration of assignment with synthetic LHS."

This reverts commit 55aa031404.

Revert "Revert "Fix analyzer/FE integration of assignments to ambiguous types.""

This reverts commit 9f795883f1.

Revert "Store code range for constructors."

This reverts commit 675b296d49.

Revert "Store codeOffset/length code fields and top-level variables."

This reverts commit 9ef53bde19.

Revert "Re-land "Fix analyzer/FE integration of assignments to ambiguous types.""

This reverts commit 40d72aec8c.

Revert "Resolve metadata for part-of directives."

This reverts commit cf1cd3eba0.

Revert "Fix analyzer/FE integration of assignment with synthetic LHS, inside class method."

This reverts commit 43a8f1d0d6.

Revert "Fix analyzer/FE integration of prefix/postfix increment of non-l-values."

This reverts commit e2aceb692e.

Revert "Fix analyzer/FE integration of postfix-of-postfix and prefix-of-prefix increments."

This reverts commit ad6f89f13b.

Revert "Fix analyzer/FE integration of some obscure invalid assignment cases."

This reverts commit f074f3c120.

Revert "Resolve namespace combinators."

This reverts commit 7e39d07916.

Revert "Fix analyzer/CFE integration of some more obscure invalid assignment cases."

This reverts commit a94e43af7c.

Revert "Refactor duplicate code in ContextAwareGenerator."

This reverts commit 1f82d37124.

Revert "Resolve required arguments after named."

This reverts commit b255f0fab6.

Change-Id: I44616db9b8ef037a2580a1ab35050da7e72ff7d8
Reviewed-on: https://dart-review.googlesource.com/72642
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-09-03 11:45:33 +00:00
Peter von der Ahé 3c5fa9fd3f Test various uses of type variables
Change-Id: I579f4ba5dce3a4e1ff8be3afb6ab8b5814108496
Reviewed-on: https://dart-review.googlesource.com/72102
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-08-31 11:16:35 +00:00
Kevin Millikin 9803d5c786 Signal an error when invoking a non-function
When invoking an expression whose static type is not a function type,
signal an error.  However, allow invocations of expressions with
static type `dynamic` or `Function`.  Fixes #32975.

Change-Id: Ia54d8df650076ad5c9c9c3a2c6f79ea31acbbbfe
Reviewed-on: https://dart-review.googlesource.com/72082
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
2018-08-31 02:30:46 +00:00
Kevin Millikin 6e63df3bfb Revert "Avoid the deprecated input error in source_loader"
Reverted because of failures on the VM reload tests.

Change-Id: I880523a5f3e14cc6d318d4493f037b79515b1dce
Reviewed-on: https://dart-review.googlesource.com/71401
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-08-24 11:03:28 +00:00
Kevin Millikin 0eb0f700b8 Avoid the deprecated input error in source_loader
Avoid using deprecated errors by hadling them on a case-by-case basis.
This is a version of https://dart-review.googlesource.com/c/sdk/+/63144
with merge conflicts resolved.

Fixes #33686

Change-Id: I726740af2db5d32f15c8103c903376bc8ea948e6
Reviewed-on: https://dart-review.googlesource.com/71161
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-08-24 09:14:15 +00:00
Aske Simon Christensen a4b3009ca5 Require super initializer to be at the end of the initializer list.
Drops code to handle special evaluation order rules for super
initializer before the end.

Initializer check code now also recovers from initializer errors.

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

Change-Id: I1024853bfd3acfef42630bdc2fc47782746b07c0
Reviewed-on: https://dart-review.googlesource.com/68060
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-08-22 10:43:08 +00:00
Aske Simon Christensen f8a96b88e9 It is an error if a final field is not initialized.
Bug: https://github.com/dart-lang/sdk/issues/33022

This commit adds an error when a final field is not initialized at all
(and there is at least one generative constructor). A later commit
will add an error for the case where a field is initialized by some,
but not all, generative constructors.

A number of classes in the Dart2js and DDC support libraries use
uninitialized final fields to indicate getters in the corresponding
native classes. This commit adds a temporary whitelist for the
affected files, which can be removed when the fields have been
replaced by external getters.

This is tracked by https://github.com/dart-lang/sdk/issues/33762

Change-Id: I6b5cee230c7cd5554da2b61da7ebddb6b0b9396e
Reviewed-on: https://dart-review.googlesource.com/63781
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
2018-08-17 12:37:52 +00:00
Jens Johansen 57d48dcc9f Fix bug in incremental compiler, only later using initialized type
Before this CL, if initializing from a dill file containing a class,
say A, but it wasn't used, and then later using it as a type, say
'A a = new A()', the class hierarchy would complain about not knowing A.

This was caused by the class hierarchy initially being constructed using
the full component of the first compile (i.e. in the example above
without any usage of A and thus without including A), and subsequent
compiles telling the class hierarchy about new classes created in that
compile. The problem was, that if the class was loaded from a dill file
(in the example above 'A' was such a class) it would never be included
if not a part of the first full component.

This CL fixes it by changing the interface to the class hierarchys
`applyTreeChanges` function and letting the class hierarchy know about
libraries too: It will now basically just be given the full component
when asked to update, and just update with the libraries it doesn't
already know about. In the example above that would - once using 'A' -
include 'A'.

Change-Id: I895100b51659938636da0bca6c80516d87b57a24
Reviewed-on: https://dart-review.googlesource.com/69302
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-08-16 13:26:08 +00:00
Jens Johansen da428bb3d4 Update status for incremental_bulk_compiler_full
Change-Id: Ifd4c66f00e16c0ce08c665e768f79c1eeb8d58d5
Reviewed-on: https://dart-review.googlesource.com/69301
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-08-16 10:44:25 +00:00