Skip to content

Make sure superclass isn't nil

Chris Watson requested to merge watzon/spectator:patch-1 into master

I was attempting to use mocks and ran into this issue

In lib/spectator/src/spectator/mocks/stubs.cr:45:37

 45 | (t.superclass.has_method?(name) && !t.overrides?(t.superclass, name))
                    ^----------
Error: undefined macro method 'NilLiteral#has_method?'

it was easily solved by just checking that t.superclass is not nil.

Merge request reports