class Crystal::Macros::Annotation

Overview

An annotation on top of a type or variable.

Defined in:

compiler/crystal/macros.cr

Instance Method Summary

Instance Method Detail

def [](index : NumberLiteral) : ASTNodeSource

Returns the value of a positional argument, or NilLiteral if out of bounds.

def [](name : SymbolLiteral | StringLiteral | MacroId) : ASTNodeSource

Returns the value of a named argument, or NilLiteral if the named argument isn't used on self.

def args : TupleLiteralSource

Returns a TupleLiteral representing the positional arguments on self.

def named_args : NamedTupleLiteralSource

Returns a NamedTupleLiteral representing the named arguments on self.

© 2012–2021 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/1.2.1/Crystal/Macros/Annotation.html