nevalang / neva

🌊 Dataflow programming language with static types and implicit parallelism. Compiles to machine code and Go
https://nevalang.org
MIT License
124 stars 7 forks source link

Ugly error message in wrong type for nodes #517

Closed dorian3343 closed 8 months ago

dorian3343 commented 8 months ago

When using a component that expects a List<T any> and you put just any as the Type for the node you receive an ugly pointer error message.

Code

const n list<int> = [215,112]
component Main(start any) (stop any) {
    nodes {
        printer Printer<any>
        len Len<any>
    }
    net {
        :start -> ($n -> len:data)
        len:res -> printer:data
        printer:sig -> :stop
    }
}

Error

std@0.10.4/builtin/base.neva:5:5 Subtype must be subtype of supertype union: want [{<nil> 0xc000037560 <nil>} {<nil> 0xc0000375f0 <nil>}], got {<nil> 0xc0000374d0 <nil>}

Screenshot image

emil14 commented 8 months ago

Fixed https://github.com/nevalang/neva/pull/519