roc-lang / roc

A fast, friendly, functional language.
https://roc-lang.org
Universal Permissive License v1.0
4.41k stars 310 forks source link

glue thinks name is duplicate when it isn't #4000

Closed BrianHicks closed 2 years ago

BrianHicks commented 2 years ago

With this Roc definition:

platform "roc-lang/rbt"
    requires {} { init : Input }
    exposes [Rbt]
    packages {}
    imports []
    provides [initForHost]

InputPath : [Path Str]

Input : [SourceInput InputPath, JobInput InputPath]

initForHost : Input
initForHost = init

roc glue says this:


thread 'main' panicked at 'Duplicate name detected - "InputPath" could refer to either TagUnion(SingleTagStruct { name: "InputPath", tag_name: "Path", payload_fields: [TypeId(0)] }) or TagUnion(SingleTagStruct { name: "InputPath", tag_name: "Path", payload_fields: [TypeId(2)] })', crates/glue/src/types.rs:342:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace```

This seems to be the minimal example. If `Path` doesn't have the `Str` member this generates glue successfully, as well as if either field of either tag in `Input` is removed, or either tag in `Input` is removed.
ayazhafiz commented 2 years ago

3991 should fix this

ayazhafiz commented 2 years ago

917JD6vzDtL

rtfeldman commented 2 years ago

@BrianHicks should be fixed on main now - can you verify if it's fixed for you?

BrianHicks commented 2 years ago

yep, looks like it!