
Issue #20866 has been updated by alanwu (Alan Wu). Assignee set to prism ---------------------------------------- Bug #20866: Prism assertion when running simplecov with branch coverage and requiring certain code https://bugs.ruby-lang.org/issues/20866#change-110405 * Author: Earlopain (A S) * Status: Open * Assignee: prism * ruby -v: ruby 3.4.0dev (2024-11-05T13:53:41Z master ed06f018bd) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- I stumbled upon the following bug report against simplecov: https://github.com/simplecov-ruby/simplecov/issues/1113 I reduced the error down to the following: ```rb # Gemfile source "https://rubygems.org" gem "simplecov" ``` ```rb # test.rb require "bundler" require "simplecov" SimpleCov.start do enable_coverage :branch end require_relative "external" ``` ```rb # external.rb def perform_completion case @completion_state when CompletionState::PERFECT_MATCH @dig_perfect_match_proc&.(@perfect_matched) end end ``` ```sh $ bundle exec ruby test.rb ruby: prism/util/pm_newline_list.c:93: pm_newline_list_line_column: Assertion `cursor >= list->start' failed. Aborted (core dumped) ``` When running with `parse.y` the error doesn't occur. -- https://bugs.ruby-lang.org/