java.lang.Object
java.lang.Record
org.aya.ref.LocalVar
- Record Components:
generateKind- whether this LocalVar is generated by aya, not exists in the source code. For example:- `| S Nat` is a ctor, but it actually is `| S (_1 Nat)` where `_1` is generated.
- `variable A : Type` is a generalized variable, but a local var is generated when some one reference to it. For example: `def foo : A => {??}` actually is `def foo {A : Type} : A => {??}` where `A` is a generated local var
- All Implemented Interfaces:
AnyVar
public record LocalVar(@NotNull String name, @NotNull org.aya.util.error.SourcePos definition, @NotNull GenerateKind generateKind)
extends Record
implements AnyVar
- API Note:
generateKind()is None after deserializing from an aya binary, because we don't need to use them after deserializing for now.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLocalVar(@NotNull String name, @NotNull org.aya.util.error.SourcePos definition, @NotNull GenerateKind generateKind) Creates an instance of aLocalVarrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull org.aya.util.error.SourcePosReturns the value of thedefinitionrecord component.booleanIndicates whether some other object is "equal to" this one.static @NotNull LocalVar@NotNull GenerateKindReturns the value of thegenerateKindrecord component.inthashCode()Returns a hash code value for this object.boolean@NotNull Stringname()Returns the value of thenamerecord component.@NotNull LocalVarrename()final StringtoString()Returns a string representation of this record class.
-
Field Details
-
IGNORED
-
-
Constructor Details
-
LocalVar
public LocalVar(@NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos definition) -
LocalVar
-
LocalVar
public LocalVar(@NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos definition, @NotNull @NotNull GenerateKind generateKind) Creates an instance of aLocalVarrecord class.- Parameters:
name- the value for thenamerecord componentdefinition- the value for thedefinitionrecord componentgenerateKind- the value for thegenerateKindrecord component
-
-
Method Details
-
from
-
rename
-
isGenerated
public boolean isGenerated() -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
name
Returns the value of thenamerecord component. -
definition
@NotNull public @NotNull org.aya.util.error.SourcePos definition()Returns the value of thedefinitionrecord component.- Returns:
- the value of the
definitionrecord component
-
generateKind
Returns the value of thegenerateKindrecord component.- Returns:
- the value of the
generateKindrecord component
-