-
Notifications
You must be signed in to change notification settings - Fork 1.7k
implicit-downcasts in analysis_options doesn't work #27622
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
Comments
I believe you're looking for |
That's not what the docs say... |
Even if I change |
@Sfshaza - where would the best place to be for filing a documentation bug? The flag has always been called @nex3 -- does it behave any better if you restart analysis server? We've seen bugs in the past where e.g. strong-mode will not be enabled correctly until a restart. |
I'm not using the server, I'm just using the CLI. |
Oh. I'm not familiar with under what conditions the CLI will use analysis_options. Does strong mode seem to be working at all? |
I'm not sure. What's a good test case for that? |
class C {
int x() => 0;
}
class D extends C {
Object x() => 'hi'; // strong mode: invalid override
} |
If I analyze this with |
yeah, that means it's not running in strong mode. I believe you're seeing #26959 -- Analyzer CLI does not use analysis_options |
I don't think that's it—I'm analyzing files, not directories, and if I write analyzer:
strong-mode: true strong mode works fine. |
this works for me: analyzer:
strong-mode:
implicit-casts: false
the problem is the leading "-", it's a YAML map not a list. Move this to https://github.com/dart-lang/site-www/issues? |
dartanalyzer, wrongly in my opinion, is sensitive to the current working directory. I think this sometimes causes problems with discovery of options files. I'm not sure that's what's happening in this case, though. |
I believe this has been moved to dart-lang/site-www#161. thanks @nex3 ! |
If I have the following
.analysis_options
file:and the following Dart file (taken from this example):
and I run
dartanalyzer test.dart
, it only reports:The same is true if I run
dartanalyzer --strong --no-implicit-casts test.dart
. However, if I delete.analysis_options
and rundartanalyzer --strong --no-implicit-casts test.dart
, I get:I've tested this against Dart 1.20.1 and 1.19.0. I think the
implicit-dynamic
flag has the same issue, but I don't know of a simple file to test it on.The text was updated successfully, but these errors were encountered: