Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Context reduction is too broad in coalton expressions. #1348

Open
YarinHeffes opened this issue Jan 9, 2025 · 0 comments
Open

Context reduction is too broad in coalton expressions. #1348

YarinHeffes opened this issue Jan 9, 2025 · 0 comments

Comments

@YarinHeffes
Copy link
Collaborator

The following block

 (coalton (progn (+ 2 "hello")))

gives the following error.

error: Unable to codegen
  --> <macroexpansion>:2:1
   |
 2 |     (PROGN
   |  ___^
   | | __^
 3 | ||    (+ 2 "hello")))
   | ||_________________^ Add a type assertion with THE to resolve ambiguity
   | |__________________^ expression has type ∀. (NUM STRING) => STRING with unresolved constraint (NUM STRING)

but, the following block

(coalton-toplevel (define x (progn (+ 2 "hello"))))

gives the following error.

error: Unknown instance
  --> <macroexpansion>:4:9
   |
 4 |        (+ 2 "hello"))))
   |           ^ Unknown instance NUM STRING

We want the same error for the case of coalton-toplevel to appear for coalton. The culprit seems to be the way we handle context reduction in the function expression-entry-point in /src/entry.lisp.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant