Skip to content

Rethink approach of 'dogfooding' in TypeCheck.Builtin module #187

@Qqwy

Description

@Qqwy

As part of #186 , the @spec!s in the TypeCheck.Builtin module had to be changed to normal @specs that do not perform type-checking to make the library compile and run correctly on Elixir v1.15.

This is unfortunate, because dogfooding the type-checking logic is a very worthwhile feature: When you use TypeCheck in your code, you get compile-time errors if you make a mistake in TypeCheck's syntax.

The technique used before, where TypeCheck.Builtin would be compiled twice, with the second compilation injecting checks by running code from the first compilation, is off the table.

Some possible alternatives which need to be investigated for feasability:

  • Still compile the module twice, but under different names: Quote the module contents and define two modules with these contents (with the second module including the former).
  • Just write the typechecks manually by adding calls to TypeCheck.conforms! inside the function definitions.
  • There may be more.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions