Skip to content

Named subject fix

Mike Miller requested to merge named-subject-fix into master

Fixed an issue where named subjects could crash the compiler

Received:

Nil assertion failed (NilAssertionError)
  from ???
  ...
Error: you've found a bug in the Crystal compiler. ...

for this code:

subject(point) { Point.new }

describe "#x" do
  subject { point.x }
end

Redefining subjects with a named subject broke. This fixes that with a simple flip in the definitions.

Merge request reports