-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Analyzer fails Language/03_Overview/1_Scoping_A02_t30 and t31 #3474
Labels
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Milestone
Comments
Added this to the M1 milestone. |
This comment was originally written by zundel@google.com Set owner to zundel@google.com. |
This comment was originally written by zundel@google.com https://chromiumcodereview.appspot.com/10699005 Added Started label. |
This comment was originally written by zundel@google.com r9171 Added Fixed label. |
DartBot
added
Type-Defect
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
labels
Jun 27, 2012
copybara-service bot
pushed a commit
that referenced
this issue
Aug 11, 2023
Revisions updated by `dart tools/rev_sdk_deps.dart`. dartdoc (https://github.com/dart-lang/dartdoc/compare/e8d00c0..5cfb1f3): 5cfb1f36 2023-08-07 Sam Rawlins Bump to analyzer 6.1.0 (#3474) ffi (https://github.com/dart-lang/ffi/compare/f01dfca..e2c01a9): e2c01a9 2023-08-08 Slava Egorov Expose pointer to free from allocators (#203) http (https://github.com/dart-lang/http/compare/7e9ed12..9f167a7): 9f167a7 2023-08-08 Alex James Remove example test from java_http (#1001) test (https://github.com/dart-lang/test/compare/5d571d6..9b1828f): 9b1828f4 2023-08-09 Nate Bosch Send a MessagePort to host on frame startup (#2072) ae2ab1ee 2023-08-08 Jacob MacDonald publish test_core v0.5.6 (#2076) 2e9bba21 2023-08-08 Jacob MacDonald fix failing casts when talking to minified apps from the host (#2075) tools (https://github.com/dart-lang/tools/compare/f14bf2e..295ff92): 295ff92 2023-08-10 Elias Yishak Fix empty string for `CLIENT_ID` from being sent when user decides to opt in (#144) bc6c9f0 2023-08-09 Elias Yishak Clean up on dart docs across all dart files under lib (#142) Change-Id: I75147259ce51f240c1dc359896ec7709bada288f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319783 Commit-Queue: Daco Harkes <dacoharkes@google.com> Reviewed-by: Daco Harkes <dacoharkes@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Auto-Submit: Devon Carew <devoncarew@google.com>
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
This issue was originally filed by zundel@google.com
The expectation is that a static warning is emitted when the variable declaration overrides the type. That part works. But there is also a compile time error in trying to use an identifier that represents a variable as a type:
Here's the code:
typedef func();
main() {
var func = 1;
checkTypeError( () {
func f = () => null; //'func' can't be used as a type in this scope.
});
}
Analyzer output:
$ dart_analyzer ./tests/co19/src/Language/03_Overview/1_Scoping_A02_t30.dart
file:/home/zundel/dart-all/dart/tests/co19/src/Language/03_Overview/1_Scoping_A02_t30.dart:21: Local variable 'func' is hiding 'FUNCTION_TYPE_ALIAS func' at <unknown>:func:0:0
20: main() {
21: var func = 1;
file:/home/zundel/dart-all/dart/tests/co19/src/Language/03_Overview/1_Scoping_A02_t30.dart:23: type "func" expected, but "VARIABLE" found
22: checkTypeError( () {
23: func f = () => null; //'func' can't be used as a type in this scope.
Compilation failed with 1 problem.
In spec version 0.10 13.2 there is an explicit example:
var i;
i j;
...
that is supposed to have a static type warning in this case in the declaration of j. The error from the analyzer is a compile-time error.
The text was updated successfully, but these errors were encountered: