Skip to content

More subtyping boo boos #996

@danieljharvey

Description

@danieljharvey
[error]: TCCompoundTypeInEquality (TInfix (Location 179 184) OpAdd (TUnknown (Location 173 184) 1) (TLiteral (Location 183 184) (TLInt (fromList (1 :| [])))))
     ╭──▶ <repl>@12:32-12:37
     │
  12 │ def betterTest = let f = \a -> a + 1;
     •                          ┬─────┬────
     •                          │     ╰────╸
     •                          ╰──────────╸
     •                                    ╰╸
─────╯
Reading "smol-core/test/static/Prelude.smol"
[error]: TCCompoundTypeInEquality (TInfix (Location 179 184) OpAdd (TUnknown (Location 173 184) 1) (TLiteral (Location 183 184) (TLInt (fromList (1 :| [])))))
     ╭──▶ <repl>@12:32-12:37
     │
  12 │ def betterTest = let f = \a -> a + 1;
     •                          ┬─────┬────
     •                          │     ╰────╸
     •                          ╰──────────╸
     •                                    ╰╸
─────╯
Reading "smol-core/test/static/Prelude.smol"
[error]: Unification error! Expected matching types but found Nat and U1 + 1.
     ╭──▶ <repl>@1:1-1:1
     │
   1 │ def id : a -> a
     •
     • ╰╸ This has type Nat
     •
  12 │ def betterTest = let f = \a -> a + 1;
     •                                ┬────
     •                                ╰╸ This has type U1 + 1
     •
     │ Note: These two values should be of the same type
─────╯

Metadata

Metadata

Assignees

No one assigned

    Labels

    typecheckerMaking the things only do the right things

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions