Commit Graph

801 Commits

Author SHA1 Message Date
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
Brian Wilkerson f3b177e481 Remove references to and uses of MemberMap
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1893313004 .
2016-04-20 07:40:02 -07:00
Brian Wilkerson 9aa64259dc Revert "Remove MemberMap in favor of HashMap"
Review URL: https://codereview.chromium.org/1898193004 .
2016-04-19 12:20:48 -07:00
Brian Wilkerson fb43f1276c Remove MemberMap in favor of HashMap
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1904433003 .
2016-04-19 11:59:44 -07:00
pq 433fd4558d Required params message fix.
Gets rid of the rogue space when no details are provided in the `@Required` constructor.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1897293003 .
2016-04-19 11:21:09 -07:00
Brian Wilkerson bf1fa31c90 Make analyzer more strong mode compliant
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1897713002 .
2016-04-16 12:28:44 -07:00
Brian Wilkerson 3084ceae83 Clean up flags for conditional directives
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1892523002 .
2016-04-14 11:47:28 -07:00
Konstantin Shcheglov 1075e3a32e Clean up reporting HintCode.UNUSED_SHOWN_NAME when a prefixed top-level function is invoked.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1882633002 .
2016-04-12 13:31:40 -07:00
Konstantin Shcheglov 2e4f8a0601 Add missing test suites to the generated/test_all suite.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1878413002 .
2016-04-12 13:18:18 -07:00
pq ac48484a07 Support for @JS() validation (#26225).
See: https://github.com/dart-lang/sdk/issues/26225

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1871103002 .
2016-04-08 13:45:46 -07:00
Konstantin Shcheglov 7ac77cfedf Refine compound assignment type.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1873913002 .
2016-04-08 12:19:23 -07:00
Sam Rawlins c1963b3995 Add an UNUSED_SHOWN_NAMES hint to the analyzer
BUG=https://github.com/dart-lang/sdk/issues/21030
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1863103002 .
2016-04-08 11:44:36 -07:00
Brian Wilkerson 03384b2319 Fix the parser to handle generic type arguments in named constructor invocations (issue 26183)
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1870733002 .
2016-04-07 11:05:19 -07:00
pq 6a430d0730 Validation of @required params (#26182).
See: https://github.com/dart-lang/sdk/issues/26182.

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

Review URL: https://codereview.chromium.org/1863803002 .
2016-04-06 06:09:44 -07:00
Brian Wilkerson f9b575e5b3 More strong mode changes to analysis_server
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1855643002 .
2016-04-01 18:00:04 -07:00
Konstantin Shcheglov d1104de8db Issue 26096. Explicitly compute the result that ensures that directives are resolved in units.
In the past computing LIBRARY_ELEMENT2 also set elements for directives
in the defining unit AST. But when this unit is flushed and reparsed
we didn't set these directive elements again because LIBRARY_ELEMENT2
is valid. Now resolving directive ASTs to elements is an explicit
dependency.

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

Review URL: https://codereview.chromium.org/1854863002 .
2016-04-01 14:00:38 -07:00
Brian Wilkerson 6dae827b70 More strong mode fixes for analyzer
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1842363004 .
2016-04-01 09:35:22 -07:00
Brian Wilkerson e531f01e73 Fix more strong mode errors in analyzer
R=rnystrom@google.com

Review URL: https://codereview.chromium.org/1847633002 .
2016-03-31 13:30:04 -07:00
Konstantin Shcheglov 498c77ef51 Issue dartdoc#1124. Get used elements from directive comments.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/dartdoc/issues/1124

Review URL: https://codereview.chromium.org/1850813002 .
2016-03-31 12:42:51 -07:00
Konstantin Shcheglov 05df65f7db Issue 26146. Get next token after '{' or '}' while skipping interpolations.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/26146

Review URL: https://codereview.chromium.org/1847093002 .
2016-03-31 10:40:43 -07:00
Konstantin Shcheglov 01c7e120dd Fix for infinite resursion while finding a concrete method.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1846703002 .
2016-03-30 12:35:43 -07:00
Leaf Petersen 4e5bc83285 Better strong mode least upper bound for interface types. Adds some
checks to handle common cases of least upper-bound computations
on type parameters and interface types in a more reasonable way
than the spec lub.

BUG=
R=rnystrom@google.com

Review URL: https://codereview.chromium.org/1843453002 .
2016-03-29 16:36:38 -07:00
Paul Berry 8835741088 Fix a corner case of constant evaluation cycle detection.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1841523003 .
2016-03-28 18:50:14 -07:00
Brian Wilkerson deae702994 Format everything in analyzer
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1842563003 .
2016-03-28 18:16:43 -07:00
Brian Wilkerson 513433d514 Sort analyzer sources
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1843473002 .
2016-03-28 17:41:52 -07:00
Konstantin Shcheglov 3899031ff5 When summarize AST, include local variables in loops and try-catch.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1842433002 .
2016-03-28 12:00:01 -07:00
Konstantin Shcheglov f6e4f4c053 Fix for labels and the 'inDeclarationContext' flag.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1839443002 .
2016-03-28 08:44:48 -07:00
Konstantin Shcheglov f175ef0116 Fix for resolveRelativeUri() when the containedUri is absolute.
R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1835643002 .
2016-03-25 12:53:21 -07:00
Paul Berry 9e52ab17e0 Consolidate duplicate code for resloving URIs.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1831133005 .
2016-03-25 10:37:36 -07:00
Leaf Petersen 77ee054678 Allow values to be returned from implicitly typed function bodied setters.
BUG=
R=rnystrom@google.com

Review URL: https://codereview.chromium.org/1827243003 .
2016-03-25 09:55:56 -07:00
Bob Nystrom c55e9ef20b Use GLB for function parameters when doing LUB in strong mode.
R=leafp@google.com

Review URL: https://codereview.chromium.org/1807213005 .
2016-03-23 13:50:49 -07:00
Konstantin Shcheglov c675ba270f Pass AnalysisOptions into SdkCreator, disable changing afterwards.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1830703002 .
2016-03-23 13:11:49 -07:00
Bob Nystrom bf4765009a Better casting of for-in loops.
Generate a cast for each element, so that code like this can be
handled correctly:

  for (String s in <dynamic>["a", "b", "c"]) { ... }

Fixes #25916.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1823793002 .
2016-03-21 16:37:29 -07:00
Brian Wilkerson 5a310a1684 Move constant implementation out of generated
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1816923002 .
2016-03-20 15:07:49 -07:00