Skip to content

unhelpful error message for a misplaced DEPRECATED pragma

The error message on a misplaced DEPRECATED pragma is less than helpful. Note that it was the latter of these that bit me.

% cat Main.hs

module Main where

import Foo.Bar

main = return ()

% cat Foo/Bar.hs

{-# DEPRECATED foo "bar" #-}

module Foo.Bar (foo) where

foo = undefined

% ghc -c Foo/Bar.hs

Foo/Bar.hs:4:0: parse error on input `module'

% ghc --make Main.hs

Foo/Bar.hs:1:0: file name does not match module name `Main'

Edited by Ian Lynagh -
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information