Skip to content

better error reporting for type errors in method arguments #258

@nikodemus

Description

@nikodemus
class Foo {}
   class method a: x b: y::Float
      [a, b]
end

> Foo a: 1 b: 1
PANIC: Float expected, got: Integer 1
001 Foo a: 1 b: 1
        ^^^^^^^^^ Float expected, got: Integer 1

Should be something like:

001 Foo a: 1 b: 1
             ^^^^ Float expected by Foo#a:b:, got: Integer 1
  1. Identify which argument is the problem
  2. Identify which method was actually called, since that might not be apparent at call site.

As an alternative, possibly:

001 Foo a: 1 b: 1
        ^^^^^^^^^ [Any, Float] expected by Foo#a:b:, got: [Integer, Integer]

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-langLanguage or library featurequality-of-lifeMakes life better: error reporting, debugging, etc

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions