Commit Graph

3034 Commits

Author SHA1 Message Date
Sam Rawlins 6e58ff0575 Do not error on dead, mandated statements at end of switch cases
BUG=https://github.com/dart-lang/sdk/issues/26673
R=brianwilkerson@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org/2064203002 .
2016-06-15 09:24:32 -07:00
Paul Berry 2eed3a1de3 Fix "ignore:" handling with upper case error codes.
Problem was introduced in c77781d27e,
which inadvertently dropped a call to toLowerCase().

R=pquitslund@google.com

Review URL: https://codereview.chromium.org/2070553002 .
2016-06-15 06:30:44 -07:00
Sam Rawlins 6b2c857cbb ExitDetector: Don't short-circuit return on non-exiting case statements
BUG=https://github.com/dart-lang/sdk/issues/26677
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2067843002 .
2016-06-14 11:31:28 -07:00
Paul Berry 7653369e50 Fix exit detection for try statements.
Previously, we assumed that if the contents of the "try" block always
exit, then the whole try statement always exits.  But this is not
correct if there is at least one catch handler that does not exit.

Fixes #26676

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2054323002 .
2016-06-11 06:06:43 -07:00
Brian Wilkerson f183ec3a45 Fix equality between subclasses of Source
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2050083002 .
2016-06-09 07:42:32 -07:00
Konstantin Shcheglov f2c17362fd Issue 26639. Set source for mock 'dart:async' library.
R=brianwilkerson@google.com, danrubel@google.com
BUG= https://github.com/dart-lang/sdk/issues/26639

Review URL: https://codereview.chromium.org/2044383003 .
2016-06-08 12:08:41 -07:00
pq 435e38ab77 @required support for super and redirecting cons (#26642).
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2045353002 .

Fixes: https://github.com/dart-lang/sdk/issues/26642
2016-06-08 11:19:43 -07:00
Brian Wilkerson f772c64cfe Add bounds check in scope lookup (issue 26633)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2047273004 .
2016-06-08 09:02:12 -07:00
Brian Wilkerson 27c0eeb0b2 Fix LUB computation in face of errors in code (issue 26631)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2043173002 .
2016-06-08 07:54:54 -07:00
Brian Wilkerson e3e72aeb01 Rework the parser to improve performance
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2041723008 .
2016-06-07 13:58:29 -07:00
pq 8b1440fd2b Fix @protected checks to play nice with generic supers (linter#257).
Fixes: https://github.com/dart-lang/linter/issues/257.

(Pardon the member-sorting churn in `hint_code_test`.)

BUG=
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2045693002 .
2016-06-06 13:14:13 -07:00
pq 8b779f33c0 Fix @protected to include closure references (linter#255).
Generalizes the check for invalid protected access.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2041873003 .

Fixes: https://github.com/dart-lang/linter/issues/255.
2016-06-06 11:43:30 -07:00
Konstantin Shcheglov 674fc7829b Create ClassElement.type lazily in ClassElementImpl and EnumElementImpl.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2038153003 .
2016-06-03 14:35:16 -07:00
Konstantin Shcheglov 17adc3ccd1 Compute ConstructorElement.returnType/type dynamically.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2033293003 .
2016-06-03 09:24:21 -07:00
pq 5a6c934a0a Fix @protected access check from within defining class (#26614).
Fixes: https://github.com/dart-lang/sdk/issues/26614.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2032363003 .
2016-06-03 09:09:46 -07:00
pq bfd06cbd77 Extend @protected to include implemented interfaces.
Fixes: https://github.com/dart-lang/linter/issues/252.
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2031053002 .
2016-06-02 16:13:03 -07:00
Sam Rawlins 38e8d9702b Revert "Revert "If an if or do statement always exits, following statements are dead.""
This reverts commit c0b0c7be81.

BUG=https://github.com/dart-lang/sdk/issues/16420
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2007933002 .
2016-06-02 15:25:08 -07:00
Sam Rawlins c2f04d2dc2 ExitDetector: Do not special case enums, since null exists
BUG=https://github.com/dart-lang/sdk/issues/26606
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2033693003 .
2016-06-02 14:15:36 -07:00
Konstantin Shcheglov f1bc40923a Report HintCode.UNUSED_FIELD for fields which are referenced in constructor field initializers.
This adds two not false positives in dart2js, and zero to DDC.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2029193003 .
2016-06-02 08:00:22 -07:00
Konstantin Shcheglov 554df80cd7 Rename ClassElementImpl and its subclasses.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2025233003 .
2016-06-01 12:41:02 -07:00
Konstantin Shcheglov be990cd134 Start separating ClassElementImpl for Class and Enum.
Maybe they should be named differently though, like ClassElementImpl
and EnumElementImpl.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2027893002 .
2016-06-01 10:38:38 -07:00
Konstantin Shcheglov 3d70bc399e Rollback checking bounds of type parameters of function type aliases.
The line:

List<DartType> parameterTypes = element.type.typeArguments;

returns an empty list for typedefs.

For now I want to unblock Keerti.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2027723002 .
2016-05-31 10:51:23 -07:00
Konstantin Shcheglov 9820588f06 Compare error names in strong_mode_test ignoring order.
These tests were flaky.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2021613002 .
2016-05-29 12:13:02 -07:00
Sam Rawlins c2794f634a Add YieldStatement support to ExitDetector
BUG=https://github.com/dart-lang/sdk/issues/26553
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2010283002 .
2016-05-27 11:44:00 -07:00
Paul Berry b1afdec64c Fix type errors introduced by 8fdeb785fd
TBR=srawlins@google.com

Review URL: https://codereview.chromium.org/2016533002 .
2016-05-25 15:20:42 -07:00
Sam Rawlins 8fdeb785fd Add label support to ExitDetector
BUG=https://github.com/dart-lang/sdk/issues/26534
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2008363002 .
2016-05-25 14:04:22 -07:00
Brian Wilkerson 7eddfb7394 Fix cross-partition dependency handling (issue 26466)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2008133002 .
2016-05-25 07:43:01 -07:00
Sam Rawlins d948ea2c17 Don't short circuit visiting else
BUG=https://github.com/dart-lang/sdk/issues/26517
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2002353003 .
2016-05-24 06:53:56 -07:00
Sam Rawlins c0b0c7be81 Revert "If an if or do statement always exits, following statements are dead."
This reverts commit d7833e1c1f.

BUG=

Review URL: https://codereview.chromium.org/2004223002 .
2016-05-23 15:15:05 -07:00
Sam Rawlins d7833e1c1f If an if or do statement always exits, following statements are dead.
BUG=https://github.com/dart-lang/sdk/issues/16420
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1943443002 .
2016-05-23 13:20:48 -07:00
Konstantin Shcheglov d78cf637b1 Use FastUri instead of Uri in analyzer.
This makes DDC compilation about 25% faster - from 1550 to 1200 ms.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2003633002 .
2016-05-20 10:33:20 -07:00
Sam Rawlins cd34de9e0e Adjust do visit in ExitDetector
BUG=https://github.com/dart-lang/sdk/issues/26473
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1985173003 .
2016-05-17 17:11:53 -07:00
pq e1fad5cddb Verify that required param constants are accessible outside the declaring lib (#26440).
A test to verify that `required` "details" are accessible in reporting errors found outside of the declaring library.

Follows up on Brian's fix: https://github.com/dart-lang/sdk/commit/23b02bc35112ebb955e006b87b3fbe03c5e071d7.

More context: https://github.com/dart-lang/sdk/issues/26440.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1975383002 .
2016-05-13 14:31:40 -07:00
Konstantin Shcheglov bd270935a5 Check bounds of type parameters of function type aliases.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1967583002 .
2016-05-10 10:49:25 -07:00
Brian Wilkerson 8c244f03ad Report when members indirectly inherited through a mixin are not implemented (issue 26411)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1951363003 .
2016-05-06 11:29:44 -07:00
Brian Wilkerson 08241e9072 More strong mode clean-up
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1947813002 .
2016-05-04 07:42:46 -07:00
Sam Rawlins 68cadb3e71 Warn about @deprecated positional parameters
BUG=https://github.com/dart-lang/sdk/issues/22975
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1936873002 .
2016-05-02 10:34:35 -07:00
Brian Wilkerson 974385bb48 Add a failing test for generic tear-offs
R=leafp@google.com

Review URL: https://codereview.chromium.org/1933783002 .
2016-04-29 10:10:10 -07:00
Konstantin Shcheglov 0f0b38dab3 Implement stable resolution of generic types without type arguments to their bounds.
R=brianwilkerson@google.com, leafp@google.com
BUG= https://github.com/dart-lang/sdk/issues/26265

Review URL: https://codereview.chromium.org/1927323002 .
2016-04-29 08:25:55 -07:00
Brian Wilkerson 1601b9b264 Add checks for type bounds on generic methods
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1927103002 .
2016-04-28 12:46:05 -07:00
John Messerly d4a81f12fb fix #26334, allow supertypes for async function returns in strong mode
R=brianwilkerson@google.com, leafp@google.com

Review URL: https://codereview.chromium.org/1924113002 .
2016-04-28 09:57:06 -07:00
Sam Rawlins 2cfa9c4665 @deprecated should work on 'called' objects
BUG=https://github.com/dart-lang/sdk/issues/9470

Example output:

$ cat -n a.dart
     1  class Foo {
     2    Foo foo;
     3
     4    @deprecated
     5    call(String name) {
     6      print("hello $name");
     7    }
     8  }
     9
    10  void main() {
    11    Foo f = new Foo();
    12    f("Thomas");
    13    f.foo = new Foo();
    14    f.foo("Timmy");
    15  }
$ xcodebuild/ReleaseX64/dart-sdk/bin/dartanalyzer a.dart
Analyzing [a.dart]...
[hint] 'Foo.call' is deprecated (/Users/srawlins/code/dart-repo3/sdk/a.dart, line 12, col 3)
[hint] 'Foo.call' is deprecated (/Users/srawlins/code/dart-repo3/sdk/a.dart, line 14, col 3)
2 hints found.

R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1922563003 .
2016-04-27 13:40:02 -07:00
Sam Rawlins 7cb775f149 provide MISSING_RETURN on factory constructors
BUG=https://github.com/dart-lang/sdk/issues/17121
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1923593002 .
2016-04-27 12:33:03 -07:00
Leaf Petersen fa39d72861 Fix missing downwards inference on fields, report more inference
Use the element type on the variable declaration to set the downwards
inference context, so that we get downwards inference from inferred
types.  Also eliminated some TODOs about places where we were not
recording inferences.

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

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1906413004 .
2016-04-22 15:29:26 -07:00
pq 6b20605984 Support ignores at end of line (#26181).
Implements: https://github.com/dart-lang/sdk/issues/26181

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1913113002 .
2016-04-22 11:06:16 -07:00
Brian Wilkerson 166f23e13f Code clean-up
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1907323002 .
2016-04-22 09:05:01 -07:00
Brian Wilkerson 4367fd8800 Add warnings when async and async* functions declare a subtype of Future or Stream respectively (issue 25854)
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1910033002 .
2016-04-21 11:03:36 -07:00
Konstantin Shcheglov 305f1f538c Pull the 'keyword' property into Token.
So, we can use it without casting to KeywordToken.
This gives small, but noticable performanace boost, about 4% on hot VM.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1909843002 .
2016-04-21 08:23:49 -07:00
Sam Rawlins 53bf36acdb Add UNDEFINED_HIDDEN_NAME, UNDEFINED_SHOWN_NAME
BUG=https://github.com/dart-lang/sdk/issues/20363

Also https://github.com/dart-lang/sdk/issues/25154, https://github.com/dart-lang/sdk/issues/25672

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1901923002 .
2016-04-20 15:51:50 -07:00
Paul Berry 8f9defbb50 Move InheritanceManager to its own file.
No changes other than code motion.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1903663003 .
2016-04-20 08:58:00 -07:00