Ticket #2030 (closed merge: fixed)

Opened 5 years ago

Last modified 5 years ago

GHC internal error: `m' is not in scope

Reported by: ToRA Owned by: igloo
Priority: normal Milestone: 6.8.3
Component: Compiler (Type checker) Version: 6.8.2
Keywords: Cc: tora@…
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Difficulty: Unknown
Test Case: tc242 Blocked By:
Blocking: Related Tickets:

Description

Tripped this while trying to use ScopedTypeVariables? under 6.8.2

Have stripped the code down as far as I could simply see while retaining the bug. isSafeAlt seems to be the starting point.

Attachments

Bug.hs Download (3.4 KB) - added by ToRA 5 years ago.

Change History

Changed 5 years ago by ToRA

Changed 5 years ago by ToRA

  • version changed from 6.8.1 to 6.8.2

Changed 5 years ago by ToRA

  • cc tora@… added

Changed 5 years ago by ToRA

  • component changed from Compiler to Compiler (Type checker)

Changed 5 years ago by ToRA

Further information.

6.6.1 will compile it. Also brings down 6.8.1

ghc-6.8.1 -v -c /tmp/Bug.hs

Glasgow Haskell Compiler, Version 6.8.1, for Haskell 98, stage 2 booted by GHC version 6.6.1 Using package config file: /home/tora/lib/ghc-6.8.1/package.conf hiding package X11-1.2.3.1 to avoid conflict with later version X11-1.4.0 wired-in package base mapped to base-3.0.0.0 wired-in package rts mapped to rts-1.0 wired-in package haskell98 mapped to haskell98-1.0.1.0 wired-in package template-haskell mapped to template-haskell-2.2.0.0 wired-in package ndp not found. Hsc static flags: -static Created temporary directory: /tmp/ghc2997_0 *** Checking old interface for main:Bug: *** Parser: *** Renamer/typechecker:

/tmp/Bug.hs:36:24:

GHC internal error: `m' is not in scope In the type `m Safety' In the type `Alt -> m Safety' In the type signature for `isSafeAlt':

isSafeAlt
Alt -> m Safety

*** Deleting temp files: Deleting: /tmp/ghc2997_0/ghc2997_0.s Warning: deleting non-existent /tmp/ghc2997_0/ghc2997_0.s *** Deleting temp dirs: Deleting: /tmp/ghc2997_0

Changed 5 years ago by ToRA

If you remove the type signature it compiles / loads fine in ghci 6.8.2

Changed 5 years ago by simonpj

  • owner set to igloo
  • testcase set to tc242
  • type changed from bug to merge

Thanks. The bug turns out to be that -XScopedTypeVariables should imply -XRelaxedPolyRec. If you add the latter flag you will be fine. I'll push a patch and some tests.

Simon

Changed 5 years ago by simonpj

See also #2037

Changed 5 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to 6.8.3

Merged

Thu Jan 10 03:31:33 PST 2008  simonpj@microsoft.com
  * Fix 2030: make -XScopedTypeVariables imply -XRelaxedPolyRec
Note: See TracTickets for help on using tickets.