ARTICLE AD BOX
Asked today
Viewed 97 times
I get an error:
CS8618: Non-nullable field 'file_path' must contain a non-null value when exiting constructor. Consider adding 'required' modifier or declaring the field as nullable.
This is really strange because upon exiting the variable file_path is not null!
7,2905 gold badges31 silver badges49 bronze badges
The compiler only checks direct variable assignments within constructor, and it does not check all the possible call trees, hence it ignores the otherwise obvious assignment.
9,8778 gold badges48 silver badges99 bronze badges
Sign up to request clarification or add additional context in comments.
Explore related questions
See similar questions with these tags.
