Skip to content

update issue with sum type, adding a new type constructor #4515

@kylegoetz

Description

@kylegoetz

I have a sum type ResourceType = Light | Device | ...... and a lot of types and terms referencing it.

When I update this by adding a new constructor to the end (... | Event) and update, I get a very long list of things added to my scratch file to update for compilation. Some of these get hashes instead of names in the scratch file.

For example,

api.SmartScene.PostBody.toJson = cases
  PostBody#ckkft7ui#0
    (Name.Name n)
    oimage
    oappdata
    (ResourceTuple id type')
    slots
    oduration
    oaction -> ...

@aryairani asked me to add this to the issue tracker.

One should be able to reproduce this error by

  1. pulling @kylegoetz/huenison/streamtest from Share (once I've resolved why push errors out with @kylegoetz/huenison does not exist on https://api.unison-lang.org)
  2. edit ResourceType
  3. add | Event2
  4. update

The first thing that shows up in the scratch file should be

unique type api.BehaviorInstance.GetBody
  = GetBody#lbung6rm#0
      ResourceId
      ResourceId
      Boolean
      (Optional Json)
      Json
      [(Text, ResourceId, ResourceType)]
      BehaviorInstanceStatus
      Text
      Name
      (Optional ResourceIdV1)

with the constructor hash.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions