Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

E011: Annotation Parse Error

Severity: Warning

type annotation for `helper` failed to parse: expected `->` or end of input

A doc comment type annotation was recognized (it starts with type: or has a # Type section) but the type expression could not be parsed.

Common causes

  • Syntax error in the type expression:
    /** type: f :: int -> -> string */   # double arrow
    
  • Using syntax that isn’t supported in tix type expressions (e.g. Haskell-style type classes).
  • Missing closing bracket or paren:
    /** type: f :: [int -> string */     # missing ]
    

How to fix

  • Check the type expression syntax for valid syntax.
  • Fix the parse error indicated in the message. Common fixes:
    /** type: f :: int -> string */          # simple function
    /** type: g :: { name: string, ... } */  # open attrset
    /** type: h :: (int | string) -> bool */ # union needs parens before ->