-
Following code no any issue, just for learn and curious. Following output come from the generated project use ╰─ $ 1 shards build
Dependencies are satisfied
Building: app
Error target app failed to compile:
Showing last frame. Use --error-trace for full trace.
In src/pages/main_layout.cr:37:26
37 | link "Sign out", to: SignIns::Delete, flow_id: "sign-out-button"
^--------------
Error: undefined constant SignIns::Delete I just curious, why the const private def render_signed_in_user
puts "1"*100
text current_user.email
text " - "
link "Sign out", to: SignIns::Delete, flow_id: "sign-out-button"
end As a comparative example, following code can't check the missing const class Foo
def foo
puts "1"*100
Bar
end
end
foo = Foo.new
# foo.foo # => will raise const missing only if uncomment this line. Thanks very much. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think this is because one of the methods in the HTML builder ends up getting called during compilation. It's a bit complex, so I forget exactly the structure, but when |
Beta Was this translation helpful? Give feedback.
I think this is because one of the methods in the HTML builder ends up getting called during compilation. It's a bit complex, so I forget exactly the structure, but when
link()
gets called, it'll typecheck the arguments. This is part of why we say Lucky has a focus on compile-time safety 😄