Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle nil case typechecking @!parse blocks (#727)
I hit this on some real-world code, reproduced it with a spec and fixed it: ``` 1) Solargraph::TypeChecker strict level complains on @!parse blocks too Failure/Error: stringified_comments[rng.start.line] ||= begin buff = associated_comments[rng.start.line] buff ? stringify_comment_array(buff) : nil NoMethodError: undefined method `start' for nil:NilClass stringified_comments[rng.start.line] ||= begin ^^^^^^ # ./lib/solargraph/source.rb:256:in `comments_for' # ./lib/solargraph/type_checker.rb:546:in `block in without_ignored' # ./lib/solargraph/type_checker.rb:543:in `reject' # ./lib/solargraph/type_checker.rb:543:in `without_ignored' # ./lib/solargraph/type_checker.rb:43:in `problems' # ./spec/type_checker/levels/strict_spec.rb:15:in `block (3 levels) in <top (required)>' ```
- Loading branch information