annotation AlwaysInline

Overview

Indicates to the compiler that it should attempt to inline the annotated method whenever possible.

@[AlwaysInline]
def foo
  1
end

This has no effect on yielding methods because they are already always inlined.

May not be used together with NoInline.

NOTE The Crystal book has a section about Built-in Annotations: AlwaysInline.

Defined in:

annotations.cr