Opened 10 years ago

Closed 7 years ago

#50 closed defect (wontfix)

Emit error for dangerous vars at top level.

Reported by: benl Owned by:
Priority: normal Milestone: 0.3.0
Component: Source Type Inferencer Version: 0.1.2
Keywords: Cc:

Description

Exporting mutable data containing monomorphic type vars is not sound because two different modules might update it at different types.

At the moment we seem to silently default such types to Unit.

thing 	:: forall a. Ref %r1 (a -> a)
	:- Mutable %r1

thing	= Ref id

In the .di file we get

foreign import thing
        :: Base.Ref %r1 (Base.Unit -> Base.Unit)
        :- Base.Mutable %r1
        ,  Base.Direct %r1
        :$ Base.Data;

Change History (7)

comment:1 Changed 10 years ago by benl

Test is T50-TopLevelMonoMutable

comment:2 Changed 10 years ago by benl

  • Version set to 0.1.2

comment:3 Changed 10 years ago by benl

  • Summary changed from Emit error for dangrous vars at top level. to Emit error for dangerous vars at top level.

comment:4 Changed 9 years ago by benl

  • Priority changed from blocker to normal

comment:5 Changed 8 years ago by benl

  • Milestone 0.1.5 deleted

Milestone 0.1.5 deleted

comment:6 Changed 7 years ago by benl

  • Milestone set to 0.3.0

comment:7 Changed 7 years ago by benl

  • Resolution set to wontfix
  • Status changed from new to closed

We're going to use polymorphism-by-name for this. Just erase type lambdas to value lambdas taking some dummy argument.

Note: See TracTickets for help on using tickets.