Commit Graph

517 Commits

Author SHA1 Message Date
Paul Berry 1a287d61be Test type inference for super index operations, especially with substitutions.
Change-Id: I25958f038f3af1ab70ba88e7405687564246fb95
Reviewed-on: https://dart-review.googlesource.com/19660
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-09 19:20:07 +00:00
Samir Jindel bc9645509e Revert "Revert "[kernel] Fix NoSuchMethod errors for generic functions.""
This un-revert fixes the issues revealed in https://logs.chromium.org/v/?s=chromium%2Fbb%2Fclient.dart%2Fvm-kernel-mac-release-x64-be%2F2217%2F%2B%2Frecipes%2Fsteps%2Fvm_tests%2F0%2Fstdout.

Patchset 1 contains the original revision unmodified.

This reverts commit 9029ee09c5.

Bug:
Change-Id: I109c011c2688144b00293ce50b3aad53e018a2f2
Reviewed-on: https://dart-review.googlesource.com/18340
Reviewed-by: Régis Crelier <regis@google.com>
2017-11-06 17:07:38 +00:00
Paul Berry cd49cf1201 Insert implicit downcasts for compound assignments.
Change-Id: I090594e16fa890864775b2ebc58842d861c134a4
Reviewed-on: https://dart-review.googlesource.com/18517
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-03 22:07:10 +00:00
Paul Berry 9ac19f0122 Pass --strong to vm when running front_end testcases in strong mode.
Also, stop passing "Hello, World!" as a command line argument when
executing front_end testcases.

Change-Id: I7c3ec6a301537a84bd14e232b5a0d6b8a7bd1914
Reviewed-on: https://dart-review.googlesource.com/18503
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-03 18:28:51 +00:00
Samir Jindel 9029ee09c5 Revert "[kernel] Fix NoSuchMethod errors for generic functions."
This reverts commit 52e1466588.

Bug:
Change-Id: Ic1b37a5df2f50ede4f6873b6d2a701663673bcbb
Reviewed-on: https://dart-review.googlesource.com/18261
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-02 16:52:32 +00:00
Samir Jindel 52e1466588 [kernel] Fix NoSuchMethod errors for generic functions.
Bug:
Change-Id: I8ad90e34a7b1f77b29f1d711f158bcb69f5928f4
Reviewed-on: https://dart-review.googlesource.com/17941
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2017-11-02 15:16:08 +00:00
Paul Berry 8620e6b24a Insert implicit downcasts for ??= assignments.
Change-Id: I272eeea96a19ad5c781113211ee466f844ffbe4b
Reviewed-on: https://dart-review.googlesource.com/17240
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-10-31 15:58:55 +00:00
Paul Berry 6f9d6965fe Insert implicit downcasts for simple assignments.
Notes on test changes:

- This revealed runtime failures in some tests in
  pkg/front_end/testcases/inference.  Since these tests were never
  meant to exercise runtime behavior in the first place, I just
  changed them so that main() does nothing.

- This revealed runtime failures in some tests in tests/language_2.
  These tests began failing because they used "var" for a fields and
  then later assigned a value to the field that was incompatible with
  the inferred type.  It looks like the intent was for these fields to
  have type "dynamic", so I changed the tests accordingly.

Change-Id: I0ddb2063427b52b5e4be1884fa333e25be4bf4f3
Reviewed-on: https://dart-review.googlesource.com/16881
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-10-27 18:27:09 +00:00
Samir Jindel 031a7ffe41 [kernel] Improve Enum representation.
Dart2JS and the VM prefer for Enum names to be stored inline in the Enum
object to avoid having the static array of all Enum values. A base class
for Enums is provided to avoid repeating the common fields and accessors
between Enum definitions.

Bug:
Change-Id: I783f863015b45f13317fda06e627d14844fe2ddf
Reviewed-on: https://dart-review.googlesource.com/16526
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-27 12:10:53 +00:00
Paul Berry cded10154c Fix type inference of compound assignments when getter/setter have different types.
For compound assignments, we need to look up the "combiner" operation
in the type of the getter (not the setter), since the receiver of the
combiner operation is the value that was read.  This is necessary for
soundness.

Change-Id: I02e0e93310b6b6b94d4a6253d4cf2fc1d3c69cd5
Reviewed-on: https://dart-review.googlesource.com/16607
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-25 18:54:17 +00:00
Peter von der Ahé e82d91efc9 Recover from bad setter in abstract method
Closes https://github.com/dart-lang/sdk/issues/31154

Change-Id: I50cac9a5873e191f72fe02314a2bb061270c684d
Reviewed-on: https://dart-review.googlesource.com/15540
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2017-10-24 11:01:18 +00:00
Paul Berry f2a50e9b5b Convert conditional "then" expression to a value before calling typePromoter.enterElse.
Otherwise this conversion will be done in the context of the "else"
expression, so promotions might not take effect properly.

Fixes #31132

Change-Id: I480f9c13636ce79f440b9c7e812f2bbaf217d975
Reviewed-on: https://dart-review.googlesource.com/14941
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-19 18:00:07 +00:00
Paul Berry 485aa072d9 Fix type inference of expressions in for loop initializers.
BodyBuilder converts an expression in a for loop initializer to the
initialization of a dummy variable.  It needed to create this dummy
variable using ShadowVariableDeclaration to ensure that type inference
would be applied to the dummy variable.

Fixes #31133

Change-Id: Ibe5ed95f20429af633cbe8d49b06aabaa9df41fd
Reviewed-on: https://dart-review.googlesource.com/15001
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-10-18 22:44:23 +00:00
Paul Berry c2d1260c4a Annotate procedures with contravariant return types.
This will allow the front end to efficiently decide where to insert
"as" checks.

Change-Id: I4776488684acdbf356ed3cb286e8d516d18719e1
Reviewed-on: https://dart-review.googlesource.com/14507
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-17 20:20:40 +00:00
Aske Simon Christensen 8a2a9e4622 Reland "Error on setter having not exactly one parameter"
Rewrite setter with invalid parameters into one with one parameter
and a body throwing a compile-time error.

Some analyzer tests fail until we sort out the expected form of the
generated kernel code in situations like this. This is tracked in
https://github.com/dart-lang/sdk/issues/31096

Closes https://github.com/dart-lang/sdk/issues/31069
Original CL: https://dart-review.googlesource.com/13080

Change-Id: I432240c33d6daf0ec6bfe2b73c609ab4762cda8c
Reviewed-on: https://dart-review.googlesource.com/14381
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2017-10-17 13:16:30 +00:00
Paul Berry 250585a70e Split forwarding node resolution into two phases.
The first phase, called `resolve`, happens during top level type
inference; it determines which inherited method a forwarding node
resolves to, and ensures that dependencies are type inferred.  The
second phase, called `finalize`, happens at the end of top level type
inference; it creates forwarding stubs if necessary and propagates
covariance annotations.

The reason we need two phases is illustrated by the new test
pkg/front_end/testcases/inference/inheritance_does_not_imply_circularity.dart.
There should be a type inference dependency from I1::x to y, and from
y to C::x.  But there shouldn't be a type inference dependency from
C::x to I1::x, since C::x's type is fully specified.

Splitting into two phases makes this work: during type inference, we
can resolve C::x without needing to consult the type of I1::x.  Once
type inference is over, and the type of I1::x has been determined, we
can finalize C::x and determine whether any covariance annotations
need to be propagated.

Change-Id: If96e7b23e16723c421f91b3e37fe2a4485919c5c
Reviewed-on: https://dart-review.googlesource.com/13600
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-10-16 21:44:23 +00:00
Paul Berry 10771e2836 Remove old code for computing formal safety.
This fixes a bug where we were unnecessarily placing covariance
annotations on final fields.

Change-Id: I2a787439890c9d258b2cbf55499706aa6a5a6d2f
Reviewed-on: https://dart-review.googlesource.com/13964
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-16 21:07:16 +00:00
Martin Kustermann 25dc42f5d8 Revert "Error on setter having not exactly one parameter"
This reverts commit 4bb83e9311
This reverts commit f1b07b2789.

Reason for revert on analyzer bots:

    Analyzing pkg/analyzer...
      error • Undefined name 'source' at pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart:625:9 • undefined_identifier
      error • Undefined name 'CompileTimeErrorCode' at pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart:625:18 • undefined_identifier
      error • Undefined name 'source' at pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart:626:13 • undefined_identifier
      error • Undefined name 'source' at pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart:635:9 • undefined_identifier
      error • Undefined name 'CompileTimeErrorCode' at pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart:635:18 • undefined_identifier
      error • Undefined name 'source' at pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart:636:13 • undefined_identifier
      error • Undefined name 'source' at pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart:645:9 • undefined_identifier
      error • Undefined name 'CompileTimeErrorCode' at pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart:645:18 • undefined_identifier
      error • Undefined name 'source' at pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart:646:13 • undefined_identifier
      error • Undefined name 'source' at pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart:655:9 • undefined_identifier
      error • Undefined name 'CompileTimeErrorCode' at pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart:655:18 • undefined_identifier
      error • Undefined name 'source' at pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart:656:13 • undefined_identifier
    12 errors found.

Change-Id: Ie2035bf40e50c48f85b514c7a3786141cd0f2453
Reviewed-on: https://dart-review.googlesource.com/14061
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-10-16 16:32:13 +00:00
Aske Simon Christensen f1b07b2789 Error on setter having not exactly one parameter
Rewrite setter with invalid parameters into one with one parameter
and a body throwing a compile-time error.

Some analyzer tests fail until we sort out the expected form of the
generated kernel code in situations like this. This is tracked in
https://github.com/dart-lang/sdk/issues/31096

Closes https://github.com/dart-lang/sdk/issues/31069
Change-Id: I65033709813671ecb933e6a4dc00d1ff3b504661
Reviewed-on: https://dart-review.googlesource.com/13080
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2017-10-16 15:07:49 +00:00
Paul Berry 078da9f5c0 Exchange the order of looping in _computeCovarianceFixes.
The outer loops are now through the arguments of the method to be
fixed, and the inner loops are through the inherited methods.  This
allows us to handle the situation where a forwarding stub is needed
because isGenericCovariantInterface changes from true to false, but
the forwarding stub doesn't need to be concrete, since
isGenericCovariantImpl is inherited from the base class.  (Previously
that situation didn't work because by the time we processed the
inheritance of isGenericCovariantImpl, we had already created a
concrete forwarding stub).

Additional fixes in this CL (necessary to get tests to pass in
meaningful ways):

- Updated InstrumentationValueForForwardingStub to print covariance
  annotations on type parameters.

- Updated _createForwardingStub to copy covariance annotations from
  the target procedure to the procedure being created.

- Moved call_through_this.dart from runtime_checks/ to
  runtime_checks_new/ because the analyzer implementation doesn't
  handle this case correctly.

Change-Id: I984a46826a3a4d8ad1a1ce840269498df049fef0
Reviewed-on: https://dart-review.googlesource.com/13963
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-16 04:07:18 +00:00
Paul Berry 494d78efd5 Transition to new top level type inference logic.
With this CL, we stop creating the old AccessorNode objects and start
creating the inference nodes associated with the new ForwardingNode
infrastructure.  This fully integrates top level type inference with
forwarding stub generation.

There is a small difference between the behavior of the old and new
type inference infrastructure: in the old infrastructure, when
inferring the type of a getter or setter, we would consider both
inherited getters and inherited setters.  Now, we follow the spec.
This introduces some minor differences from analyzer functionality, so
the tests of this functionality are moved into the "inference_new"
directory.

Change-Id: Ie17df9abf1a3ab99e7d22683ffdf6d1b13ec86be
Reviewed-on: https://dart-review.googlesource.com/13180
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-11 21:32:10 +00:00
Paul Berry 7df0fb6c28 Add type propagation support for conditional expressions.
This required adding a few extra parser events to allow the type
propagator to update its state when the `?` and `:` are encountered
(similar to what was done for `if`).

Fixes #30620.

Change-Id: I0d3ede8056fd8bab01ead5b242d00803286c9373
Reviewed-on: https://dart-review.googlesource.com/13182
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-11 20:21:22 +00:00
Paul Berry df9889787c Propagate type inference out of logical expressions.
This addresses some of the failures reported in #30620.

Change-Id: I4a528a2d45ef5df814063b433dcf8a664cce4097
Reviewed-on: https://dart-review.googlesource.com/13000
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-11 17:04:17 +00:00
Paul Berry 655d3ce665 Account for forwarding nodes when looking up inherited members in InterfaceResolver.
This allows covariance information to propagate properly between
classes and avoids creation of unnecessary forwarding stubs.

Change-Id: Ib55c62adb74d16f94282e752e387634086001946
Reviewed-on: https://dart-review.googlesource.com/12600
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-10 15:55:14 +00:00
Sigmund Cherem 80e7d3b35f Build a strong version of outline.dll, and use it for front end strong mode tests.
(rebases CL 11366 after Peter's changes)

Change-Id: If9f3d331fb953a9890fa7952bd472cc39f541e84
Reviewed-on: https://dart-review.googlesource.com/11965
Reviewed-by: Paul Berry <paulberry@google.com>
2017-10-06 20:12:59 +00:00
Paul Berry 039f82f7ed Include generic covariance annotations for type parameters in kernel output.
This was inadvertently left out of f94d3950ad.

Change-Id: Ifc3bbd8358322e112bf6b57fc751570d6101c9b6
Reviewed-on: https://dart-review.googlesource.com/11561
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-05 21:40:53 +00:00
Paul Berry f94d3950ad Include generic covariance annotations in kernel text output.
Change-Id: I81a7b3ea692e94d7e9bbd8562f1771a7626e0715
Reviewed-on: https://dart-review.googlesource.com/10803
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-05 05:23:43 +00:00
Paul Berry 7c82b747f8 Actually store forwarding stubs in Class objects.
Change-Id: I3792688a61cdba49b38a8da7f27e9b305fa7a54e
Reviewed-on: https://dart-review.googlesource.com/10704
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-04 17:30:49 +00:00
Peter von der Ahé cda4f284b0 Implement warnings on unresolved this-sends.
Change-Id: Ia9ab202e157102c22b2705d13582d3529288f81e
Reviewed-on: https://dart-review.googlesource.com/8502
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2017-10-04 08:21:32 +00:00
Aske Simon Christensen 868f5d9fa6 Recover from error in for initializer
When a variable declaration in a for initializer has an error,
an error-throwing expression statement is produced by the general
variable declaration parser code. The body builder was not prepared
for this, but was trivially extended to handle it.

Closes https://github.com/dart-lang/sdk/issues/29984
Change-Id: Iace9a095cc150e26e62ed17716823e62e5d2ece3
Reviewed-on: https://dart-review.googlesource.com/8801
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-03 15:09:09 +00:00
Régis Crelier db8b20107b Revert "Revert "Dart Core Lib change to support generic functions in class NoSuchMethodError.""
This reverts commit 8cf9ef22c4.

The expectations in Dart2js and Kernel tests have now been updated.

Change-Id: I9d65ff207490cfc783849b1b726db81cf56ecfc2
Reviewed-on: https://dart-review.googlesource.com/9124
Reviewed-by: Régis Crelier <regis@google.com>
2017-09-28 00:27:24 +00:00
Peter von der Ahé 5bd48bf6f4 Implement instrumentation of warnings.
Change-Id: Ifa1e093dd40b7b36da28adaf6193fb35996872fb
Reviewed-on: https://dart-review.googlesource.com/7555
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-09-22 11:35:22 +00:00
Paul Berry 2d74043f3a Implement type promotion of type parameter bounds.
Fixes #30804.

Change-Id: I16094e54514b2109fda4b388083d2467a0b11bc7
Reviewed-on: https://dart-review.googlesource.com/7105
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-09-19 23:19:46 +00:00
Paul Berry 6bf3330e29 Enable a test now that #30034 is fixed
Change-Id: Ie8796e7d66281329917ea5b1cb50278a00325a88
Reviewed-on: https://dart-review.googlesource.com/5890
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-09-14 20:21:29 +00:00
Paul Berry 872c843040 Suppress type promotion when the promoted type would not be a subtype.
Fixes #30699.

Change-Id: I2b3d93e5dbef208f2266bcae4954bebec19cb1cd
Reviewed-on: https://dart-review.googlesource.com/5887
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-09-14 20:04:26 +00:00
Paul Berry ea50970060 In non-strong mode, only infer return types of function expressions, not local functions.
Change-Id: I7e1295f0244e1bd4b8556d49efa2f3b345404ed3
Reviewed-on: https://dart-review.googlesource.com/5502
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-09-13 21:50:20 +00:00
Konstantin Shcheglov cb2fba6dbc Serialize and print typedef annotations.
R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com

Bug:
Change-Id: Icb3a4452603753de645b3fb4280152799f26bb61
Reviewed-on: https://dart-review.googlesource.com/5323
Reviewed-by: Paul Berry <paulberry@google.com>
2017-09-13 03:56:49 +00:00
Paul Berry 8f1ca007f2 Fix type inference for const expressions.
The inferred types for const expressions shouldn't refer to type
variables that are in scope, because at runtime those type variables
may take on different values at different times (meaning the const
expression isn't actually const after all).

Test cases are in inference_new, since analyzer implements incorrect
behavior.

Fixes #30677.

Change-Id: I27b9a95a92557ad1ce1c2c0f28d9a760c372d52a
Reviewed-on: https://dart-review.googlesource.com/5298
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-09-12 21:43:49 +00:00
Paul Berry a734f9908f Store types in auxiliary nodes introduced by desugared property assignments.
Change-Id: If1457f34d80d9b9b560bc678db3fed13bed20fdf
Reviewed-on: https://dart-review.googlesource.com/4601
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-09-08 21:50:24 +00:00
Paul Berry ce47db6075 Store types in auxiliary nodes introduced by simple desugared assignments.
This CL addresses desugared assignments produced for assignments to
local and static variables.

Change-Id: I1e02745c65ef717a8f6484a0eed35c4ada3b89ac
Reviewed-on: https://dart-review.googlesource.com/4280
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-09-08 18:11:21 +00:00
Paul Berry 9ab1a30598 Store types in auxiliary nodes introduced by desugared indexed assignments.
Fixes #30582.

I'll address other kinds of assignments (assignment to a local
variable, static field/setter, or property) in follow up CLs.

Change-Id: I9055e951dc23a4aa1aa19489cf99a832319938c9
Reviewed-on: https://dart-review.googlesource.com/4184
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-09-07 22:25:45 +00:00
Paul Berry 4d8b18a3b3 Infer return types of local functions appropriately in non-strong mode.
Fixes #30629

Change-Id: I4928521c8b2714167c3cfbd971d2dcb9d3aa79b5
Reviewed-on: https://dart-review.googlesource.com/4141
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-09-07 20:25:05 +00:00
Paul Berry a1f4874a00 Implement type promotion for logical expressions.
This CL implements type promotion logic for both `&&` and `||`;
however, the logic for `||` has no effect, since `_factsWhenFalse`
always returns the current facts.  This is consistent with the current
Dart specification (which only specifies type promotion for `&&`).

Change-Id: I79f608aa33ea0501bb4bba303949330af2da4dda
Reviewed-on: https://dart-review.googlesource.com/3345
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-09-06 17:12:52 +00:00
Paul Berry 068c78e9d7 Change type inference of ?? to match analyzer, prep for future fixes.
Previous to this CL, inference of `??` matched the behavior specified
in the informal spec (https://github.com/dart-lang/sdk/pull/29371),
whereas inference of `?:` matched analyzer behavior.

In the long run, we want the behavior of both `??` and `?:` to match
the spec (note that the spec is still being debated, so this is a
moving target).  But for now, to ease the transition to the new front
end, we want to match analyzer behavior.

With this CL, the inference for `??` is changed to match analyzer
behavior, and a boolean is introduced to make it easy for us to switch
to the behavior specified in the informal spec when it's appropriate
to do so.

Should address the inconsistency pointed out in #30624.

Change-Id: I33d95cd59e4c7e474f3ba27491be87c1bf66d85e
Reviewed-on: https://dart-review.googlesource.com/3421
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-09-06 15:16:43 +00:00
Peter von der Ahé 48503c8720 Don't export unnamed mixins.
Fixes https://github.com/dart-lang/sdk/issues/30553

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/3004703002 .
2017-08-29 16:33:33 +02:00
Peter von der Ahé 6eff945874 Mark top-level error field as static.
Closes https://github.com/dart-lang/sdk/issues/30431

R=sjindel@google.com

Review-Url: https://codereview.chromium.org/2999033002 .
2017-08-29 12:39:00 +02:00
Peter von der Ahé 07cf2557ed Implement type variables on local function declarations and expressions.
Closes https://github.com/dart-lang/sdk/issues/29798

R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2994973002 .
2017-08-15 11:21:01 +02:00
Paul Berry ae4cbb50af Use "bool" as the downward inference context for assert conditions.
This addresses the type inference part of #30326.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2997513002 .
2017-08-07 10:36:51 -07:00
Paul Berry 1b9ba53fb6 Implement type inference for asserts in constructor initializers.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2995553002 .
2017-08-04 17:55:11 -07:00
Paul Berry 1b03375d62 Implement type inference for super initializers.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2992263002 .
2017-08-03 19:39:13 -07:00