johnynek / bosatsu

A python-ish pure and total functional programming language
Apache License 2.0
223 stars 11 forks source link

Incorrect variance inference with some recursive types. #1083

Closed johnynek closed 7 months ago

johnynek commented 7 months ago

The Build example in BuildLibrary.bosatsu is being inferred as invariant, but I think that should be covariant. If you annotate it as covariant it fails with a bad error.

johnynek commented 7 months ago

This was confusion on my part. The Build example has a Leibniz[a, File] which is definitely invariant in a which makes Build invariant in a.