haskell / haskell/haskell-mode

Error in haskell-font-lock--select-face-on-type-or-constructor

Open
#1,562 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Emacs Lisp
Stars
1.4k
Forks
354
Avg merge
5d 10h
Merged PRs (30d)
2

Description

The error occurs after some time when editing Haskell code. The error is:

haskell-font-lock--select-face-on-type-or-constructor: Wrong type argument: number-or-marker-p, nil

The backtrace is:

```
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
haskell-lexeme-classify-by-first-char(nil)
haskell-font-lock--select-face-on-type-or-constructor()
haskell-font-lock--put-face-on-type-or-constructor()
(progn (goto-char (match-end 0)) (haskell-font-lock--put-face-on-type-or-constructor))
(if (save-excursion (goto-char (match-beginning 0)) (haskell-lexeme-looking-at-qidsym)) (progn (goto-char (match-end 0)) (haskell-font-lock--put-face-on-type-or-constructor)))
(when (save-excursion (goto-char (match-beginning 0)) (haskell-lexeme-looking-at-qidsym)) (goto-char (match-end 0)) (haskell-font-lock--put-face-on-type-or-constructor))
(if (or (elt (syntax-ppss) 3) (elt (syntax-ppss) 4)) (parse-partial-sexp (point) (point-max) nil nil (syntax-ppss) (quote syntax-table)) (when (save-excursion (goto-char (match-beginning 0)) (haskell-lexeme-looking-at-qidsym)) (goto-char (match-end 0)) (haskell-font-lock--put-face-on-type-or-constructor)))
eval((if (or (elt (syntax-ppss) 3) (elt (syntax-ppss) 4)) (parse-partial-sexp (point) (point-max) nil nil (syntax-ppss) (quote syntax-table)) (when (save-excursion (goto-char (match-beginning 0)) (haskell-lexeme-looking-at-qidsym)) (goto-char (match-end 0)) (haskell-font-lock--put-face-on-type-or-constructor))))
font-lock-fontify-keywords-region(1 19467 nil)
font-lock-default-fontify-region(1 19467 nil)
font-lock-fontify-region(1 19467 nil)
font-lock-default-fontify-buffer()
#[(_beg _end) "?\205\302 \210 ?\205\303\211\207" [font-lock-fontified font-lock-mode font-lock-default-fontify-buffer nil] 2](1 19467)
font-lock-ensure()
intero-fontify-expression("[14 of 14] Compiling
intero-read-buffer()
#[(process string) "\203 \306\307 \"\210\310\311\n!!\205Qr\311\n!q\210db\210 c\210 \203N\f\203N\312\313 \314 \"\315\316
\"\203I\306\317\320\321\322\323
#\323\324#@\206C\325\227\"\210\202M\306\326!\210)\327 )\207" [intero-debug string process intero-try-with-build intero-starting last-line message "[Intero] <- %s" buffer-live-p process-buffer buffer-substring-no-properties line-beginning-position line-end-position string-match "^Progress" "Booting up intero (building dependencies: %s)" split-string replace-regexp-in-string "+" "\n" t "..." "Booting up intero ..." intero-read-buffer] 7](# "\n:1:1: error: parse error on input ‘data’\n")
```

The `haskell-font-lock--select-face-on-type-or-constructor` function is defined [here](https://github.com/haskell/haskell-mode/blob/28b9d36026d83ddca69513796d63651ffcaa0a48/haskell-font-lock.el#L321).

A potentially related issue is https://github.com/haskell/haskell-mode/issues/1485 .

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.