8000 Explain a batch of value and type errors by akoskovacs · Pull Request #8 · kexhq/oops · GitHub
[go: up one dir, main page]

Skip to content

Explain a batch of value and type errors - #8

Merged
akoskovacs merged 1 commit into
mainfrom
explanations-9
Nov 22, 2026
Merged

akoskovacs merged 1 commit into
mainfrom
explanations-9

Conversation

@akoskovacs
Copy link
Copy Markdown
Contributor

Twelve more explanations under codes/.

Constructors and patterns:

  • KEXET-0103: a constructor of two values given one
  • KEXET-0105: a constructor value of the wrong type, by position
  • KEXET-0114: a pattern that names fewer values than the constructor holds
  • KEXET-0405: a constructor such as Just passed where map wants a function

Conditions and branches:

  • KEXET-0444: if and elif branches giving different types
  • KEXET-0448: a while condition that is not a Bool
  • KEXET-0458: a then ... else condition that is not a Bool
  • KEXET-0442: a range from an Integer to a Float

Fallbacks and type parameters:

  • KEXET-0430: .or(Ok(...)) on a Result
  • KEXET-0434: .or { ... } on a Result
  • KEXET-0435: .or(~function), a function where .or wants a value
  • KEXET-0462: a method called on a type parameter X that not every type has

Each broken example gives the output shown with kex built from main (371bbdff), and each fix compiles and runs.

Constructors and patterns given the wrong number or type of values, a constructor passed where a function is wanted, if and elif branches of different types, while and then conditions that are not Bool, a range between an Integer and a Float, .or given a Result, a block or a function, and a type parameter used as if it were one type. Every example was checked with kex built from main.
@akoskovacs
akoskovacs merged commit 7942d7e into main Nov 22, 2026
3 checks passed
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

Successfully merging this pull request may close these issues.

1 participant

0