Reputation: 2289
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?
Upvotes: 3
Views: 155
Reputation: 4857
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)
Search through your project and dependencies for class RateLimiter
giving conflicting definitions of that type.
Upvotes: 6