[go: up one dir, main page]

kex oops docs ↗ kex.run ↗

All codes › Parse

KEXEP-0058

error LowercaseTypeParameter

[KEXEP-0058]: Error, type parameters are uppercase: write `upper` rather than `name`

A type parameter, which stands for any type, is a single capital letter. x is lowercase.

let firstOr(items: [x], fallback: x) -> x = items.first.or(fallback)
example.kex:1:21: [KEXEP-0058]: Error, type parameters are uppercase: write `X` rather than `x`
  |
1 | let firstOr(items: [x], fallback: x) -> x = items.first.or(fallback)
  |                     ^

Fixing it

let firstOr(items: [X], fallback: X) -> X = items.first.or(fallback)

main do
  IO.printLine(firstOr([], 7))
end

Edit this explanation

Is this diagnostic reported where it should not be, missing where it should be, or saying the wrong thing? Report it on the compiler's issue tracker.