Class: RBS::TypeAliasRegularity::Diagnostic
- Inherits:
-
Object
- Object
- RBS::TypeAliasRegularity::Diagnostic
- Defined in:
- sig/type_alias_regularity.rbs,
lib/rbs/type_alias_regularity.rb
Overview
Diagnostic represents an non-regular type alias declaration error.
It consists of the name of the alias type and a type on which the nonregularity is detected.
type t[T] = Integer | t[T?]
The type t is nonregular because it contains t[T?] on it's right hand side.
diagnostic = validator.nonregular?(TypeName.parse("::t"))
diagnostic.type_name # => TypeName.parse("::t")
diagnostic.nonregular_type # => t[T?]
Instance Attribute Summary collapse
-
#nonregular_type ⇒ Types::Alias
readonly
Returns the value of attribute nonregular_type.
-
#type_name ⇒ TypeName
readonly
Returns the value of attribute type_name.
Instance Method Summary collapse
-
#initialize(type_name:, nonregular_type:) ⇒ Diagnostic
constructor
A new instance of Diagnostic.
Constructor Details
#initialize(type_name:, nonregular_type:) ⇒ Diagnostic
Returns a new instance of Diagnostic.
8 9 10 11 |
# File 'lib/rbs/type_alias_regularity.rb', line 8 def initialize(type_name:, nonregular_type:) @type_name = type_name @nonregular_type = nonregular_type end |
Instance Attribute Details
#nonregular_type ⇒ Types::Alias (readonly)
Returns the value of attribute nonregular_type.
6 7 8 |
# File 'lib/rbs/type_alias_regularity.rb', line 6 def nonregular_type @nonregular_type end |
#type_name ⇒ TypeName (readonly)
Returns the value of attribute type_name.
6 7 8 |
# File 'lib/rbs/type_alias_regularity.rb', line 6 def type_name @type_name end |