3

I am trying to implement a rate-limiting handler with Kemal.

I have a class, RateLimiter, that inherits the class Kemal::Handler. On compile I get the error:

Error in src/rate_limiter.cr:5: superclass mismatch for class RateLimiter (Kemal::Handler for Reference)

I'm new to Crystal and that means nothing to me. What am I doing wrong?

dkimot
  • 2,239
  • 4
  • 17
  • 25

1 Answers1

6

This indicates that RateLimiter was defined previously somewhere, without any explicit superclass specification:

class Base; end
class Foo; end
class Foo < Base; end

That gives

Error in line 3: superclass mismatch for class Foo (Base for Reference)

https://carc.in/#/r/3r2l

Search through your project and dependencies for class RateLimiter giving conflicting definitions of that type.

Jonne Haß
  • 4,792
  • 18
  • 30