Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Seq doesn't handle type inference as well as Vector equivalents #1322

Closed
Izaakwltn opened this issue Oct 29, 2024 · 1 comment
Closed

Seq doesn't handle type inference as well as Vector equivalents #1322

Izaakwltn opened this issue Oct 29, 2024 · 1 comment

Comments

@Izaakwltn
Copy link
Collaborator

(coalton-toplevel

  (define (vec-example)
    (vec:make "wow" "ok" (into 3)))

  ;; doesn't compile
  (define (seq-breaks)
    (seq:make "wow" "ok" (into 3)))

  ;; also doesn't compile
  (define (seq-also-breaks)
    (the (seq:Seq String)
         (seq:make "wow" "better" (into 3))))

  ;; compiles
  (define (seq-works)
    (seq:make "wow" "better" (the String (into 3)))))

This is the error from seq-break:

error: Ambiguous predicate
  --> <macroexpansion>:5:31
   |
 5 |      (SEQ:MAKE "wow" "ok" (INTO 3))))
   |                                 ^ Ambiguous predicate NUM :A
   [Condition of type SB-INT:COMPILED-PROGRAM-ERROR]

And from seq-also-breaks:

error: Ambiguous predicate
  --> <macroexpansion>:5:57
   |
 5 |      (THE (SEQ:SEQ STRING) (SEQ:MAKE "wow" "better" (INTO 3))))
   |                                                           ^ Ambiguous predicate NUM :A
   [Condition of type SB-INT:COMPILED-PROGRAM-ERROR]
@YarinHeffes
Copy link
Collaborator

Fixed in #1353

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

No branches or pull requests

2 participants