fmease / lushui

The reference compiler of the Lushui programming language
Apache License 2.0
5 stars 0 forks source link

Wrong extra diagnostic claiming undefined exposure reach when the latter is not a module #69

Closed fmease closed 2 years ago

fmease commented 3 years ago

Example:

@(public Box)
data Box: Type of
    box: Type -> Box

;;; it should only output the error about `Box` not being a module
;;; but it also outputs a second error complaining about `Box` not being defined when it clearly is!!

Output:

error[E022]: binding `Box` is not a module
 --> /home/fmease/programming/main_projects/lushui/bugs/weird-diagnostic-exposure-reach-undefined-but-it-is.lushui:1:10
  |
1 | @(public Box)
  |          ^^^
  |

error[E021]: binding `Box` is not defined in this scope
 --> /home/fmease/programming/main_projects/lushui/bugs/weird-diagnostic-exposure-reach-undefined-but-it-is.lushui:1:10
  |
1 | @(public Box)
  |          ^^^
  |
 help: a binding with a similar name exists in scope: `box` (Bbox)