johnynek / bosatsu

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

Improve external def parsing #1188

Closed johnynek closed 3 months ago

johnynek commented 3 months ago

close #1170

This does a few things:

  1. allows external def to have type parameters. This allows setting the kinds on the type parameters other than kind *.
  2. error if the type parameters do not exactly match the free types in the external def.
  3. verify that the final type of the external def is well kinded. Previously, we just took parsed syntax and accepted whatever was claimed, but that allowed to make values of the wrong kind.
codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 96.07843% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 91.49%. Comparing base (04a0e87) to head (20ce57e). Report is 20 commits behind head on main.

:exclamation: Current head 20ce57e differs from pull request most recent head 01f3832. Consider uploading reports for the commit 01f3832 to get more accurate results

Files Patch % Lines
.../main/scala/org/bykn/bosatsu/SourceConverter.scala 96.42% 1 Missing :warning:
...re/src/main/scala/org/bykn/bosatsu/Statement.scala 90.00% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1188 +/- ## ========================================== + Coverage 91.32% 91.49% +0.17% ========================================== Files 96 96 Lines 11846 12047 +201 Branches 2675 2763 +88 ========================================== + Hits 10818 11023 +205 + Misses 1028 1024 -4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.