pschachte / wybe

A programming language supporting most of both declarative and imperative programming
MIT License
43 stars 6 forks source link

Type is unknown to the importer module with strange workarounds #418

Closed wnats closed 8 months ago

wnats commented 11 months ago

d.wybe

pub constructor empty 

pub type a is address {}

pub type c is address {}

b.wybe

use d

?b:d= empty:d

Compiling b.wybe yields:

Error detected during type checking of module(s) b
In unification, unknown type d
test/test/b.wybe:3:2: In unification, unknown type d
test/test/b.wybe:3:8: In unification, unknown type d

The issue could be avoided by one of the following:

  1. Change the visibility of one of a or c to private
  2. Remove one of a or c
  3. Rename either a, c or d.
jimbxb commented 10 months ago

I havent yet trawled through the logs, but this is bizarre.

Two things that stick out as really odd are:

On the lack of location, I believe it should always be possible to get a file-location, which would be nice to have as a fallback when we don't have a location for an error.

pschachte commented 8 months ago

Fixed by #443. Turned out to be a mangled Map that had multiple copies of the same key.