[nullsafety] Non-nullable check warnings#12231
Open
RblSb wants to merge 1 commit intoHaxeFoundation:developmentfrom
Open
[nullsafety] Non-nullable check warnings#12231RblSb wants to merge 1 commit intoHaxeFoundation:developmentfrom
RblSb wants to merge 1 commit intoHaxeFoundation:developmentfrom
Conversation
Contributor
|
I will try to fix diagnostics vs cache early next week, that behavior is currently more or less expected. Edit: was mostly about haxe.warning rules vs cached modules, but there are several things wrong in this PR that I'm working on fixing |
Contributor
|
Reworked to make it work with type level [Kinda] works with: @:nullSafety
@:haxe.warning("+WRedundantNullCheck") // Notice the "+" instead of "-"
class Main {
static function main() {}
// TODO
// @:haxe.warning("+WRedundantNullCheck")
function new() {
final foo = "1";
// this warning does react to +WRedundantNullCheck
// but still hides after vscode tab swap (warnings added in filter happen too late.. need to think about it)
final v = foo ?? "0";
ignore(v);
}
static function ignore<T>(v:T):Void {}
}Field/expression level is doable but more annoying to handle. Can definitely be done, though. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cannot undestand problem with warning diagnostics, need some help:
(nullsafety warnings will stay if there is nullsafety errors btw)
Closes #7816