Ticket #78 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

Renamer problems in data type defs

Reported by: benl Owned by:
Priority: blocker Milestone: 0.1.3
Component: Source Parser Version: 0.1.2
Keywords: Cc:

Description

Added by Jared

The following fails to compile.

data Foo = Foo
data Bar = Foo

The same failure can also be triggered by redefining a constructor in the same type:

data Baz = Baz | Baz

Note that the following, which probably shouldn't compile, does:

data Foo = Foo
data Foo = Bar

The error message for the failures is

FREAKOUT in Desugar.Slurp.Util
        bindVtoT: var 'Test.Foo' is already bound
            trying to bind Var {name = "Foo", nameModule = ModuleAbsolute
["Test"], nameSpace = NameValue,bind = XBind "vR" 368, info = [ISourcePos
(SourcePos ("./Test.ds",3,12)),IBoundBy (Var {name = "Foo", nameModule =
ModuleAbsolute ["Test"], nameSpace = NameValue, bind = XBind "vR" 368, info
= [ISourcePos (SourcePos ("./Test.ds",2,12))]})]}

            conflicts with Var {name = "Foo", nameModule = ModuleNil,
nameSpace = NameType, bind = XBind "tTC" 593, info = [IValueVar (Var {name
= "Foo", nameModule = ModuleAbsolute ["Test"], nameSpace = NameValue, bind
= XBind "vR" 368, info = [ISourcePos (SourcePos
("./Test.ds",2,12)),IBoundBy (Var {name = "Foo", nameModule =
ModuleAbsolute ["Test"], nameSpace = NameValue, bind = XBind "vR" 368, info
= [ISourcePos (SourcePos ("./Test.ds",2,12))]})]})]}


        Please report this bug to the maintainers at:
[URL and email address snipped]

ddc: Pattern match failure in do expression at
src/Desugar/Slurp/Slurp.hs:267:1-20

Change History

Changed 5 years ago by erikd

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

Fixed in the following set of commits:

Mon Nov 2 21:51:47 EST 2009 Erik de Castro Lopo <erikd@…>

Mon Nov 2 21:44:38 EST 2009 Erik de Castro Lopo <erikd@…>

  • Update 01-Error/Redefined to test for redefined Data and Ctor names.

Mon Nov 2 21:34:52 EST 2009 Erik de Castro Lopo <erikd@…>

  • Catch and error out on redfinition of data and constructor names.

Mon Nov 2 20:59:00 EST 2009 Erik de Castro Lopo <erikd@…>

  • Remove duplicate type defs from library.

Mon Nov 2 18:23:55 EST 2009 Ben.Lippmeier@…

  • Remove duplicate type defs from Base.ds

Thu Oct 29 14:58:42 EST 2009 Erik de Castro Lopo <erikd@…>

Note: See TracTickets for help on using tickets.