#7809 closed bug (fixed)

Silly error message suggesting LiberalTypeSynonyms

Reported by: goldfire Owned by:
Priority: normal Milestone: 7.8.1
Component: Compiler (Type checker) Version: 7.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: typecheck/should_fail/T7809 Blocked By:
Blocking: Related Tickets:

Description

The following code (rightly) does not compile:

{-# LANGUAGE RankNTypes, TypeFamilies, LiberalTypeSynonyms #-}

type PolyId = (forall a. a -> a)

type family F a

foo :: F PolyId
foo = undefined

The error message is

    Illegal polymorphic or qualified type: PolyId
    Perhaps you intended to use -XLiberalTypeSynonyms
    In the type signature for `foo': foo :: F PolyId

The code doesn't compile because we can't apply a type family to a polytype. The first line of the error message says this well enough, though more information might be helpful here. However, the second line of the error message is silly: I've turned on LiberalTypeSynonyms!

Change History (3)

comment:1 Changed 12 months ago by igloo

  • Component changed from Compiler to Compiler (Type checker)
  • Difficulty set to Unknown
  • Milestone set to 7.8.1

Thanks for the report

comment:2 Changed 11 months ago by simonpj@…

commit 936001caa0dc045aa937c9f256b338429664d83c

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Thu May 30 12:33:56 2013 +0100

    Improve validity check to give better error message
    
    Fixes Trac #7809

 compiler/typecheck/TcValidity.lhs |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

comment:3 Changed 11 months ago by simonpj

  • Resolution set to fixed
  • Status changed from new to closed
  • Test Case set to typecheck/should_fail/T7809
Note: See TracTickets for help on using tickets.