Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,866
    • Issues 4,866
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 458
    • Merge requests 458
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #12597
Closed
Open
Created Sep 14, 2016 by Joachim Breitner@nomeataDeveloper

-Wmissing-signatures uses forall even when invalid in source

The -Wmissing-signatures warning is great to learn about the signatures that things should have, and is especially useful when teaching Haskell to beginners.

Unfortunately, it uses explicit quantification (forall) even when in the compiled module, this is not valid:

$ echo 'foo x = x' > Foo.hs
$ ghci -Wall Foo.hs
GHCi, version 8.0.1: http://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Main             ( Foo.hs, interpreted )

Foo.hs:1:1: warning: [-Wmissing-signatures]
    Top-level binding with no type signature: foo :: forall t. t -> t
Ok, modules loaded: Main.
*Main> 
$ echo -e 'foo :: forall t. t -> t\nfoo x = x' > Foo.hs
$ ghci -Wall Foo.hs
GHCi, version 8.0.1: http://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Main             ( Foo.hs, interpreted )

Foo.hs:1:16: error:
    Illegal symbol '.' in type
    Perhaps you intended to use RankNTypes or a similar language
    extension to enable explicit-forall syntax: forall <tvs>. <type>
Failed, modules loaded: none.

The type signature provided by -Wmissing-signatures should be in a form that is valid in the context of the function that is missing the signature.

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking