java.lang.Object
java.lang.Record
org.aya.resolve.context.BindContext
- All Implemented Interfaces:
Context,Problematic
public record BindContext(@NotNull Context parent, @NotNull String name, @NotNull org.aya.syntax.ref.LocalVar ref)
extends Record
implements Context
Introduces a locally bound variable to the context.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.aya.resolve.context.Context
Context.ResolvingInterruptedException -
Constructor Summary
ConstructorsConstructorDescriptionBindContext(@NotNull Context parent, @NotNull String name, @NotNull org.aya.syntax.ref.LocalVar ref) Creates an instance of aBindContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionkala.collection.mutable.MutableList<org.aya.syntax.ref.LocalVar> collect(@NotNull kala.collection.mutable.MutableList<org.aya.syntax.ref.LocalVar> container) final booleanIndicates whether some other object is "equal to" this one.@Nullable ModuleExportgetModuleLocalMaybe(org.aya.syntax.concrete.stmt.ModuleName.Qualified modName) Trying to get aModuleExportby a module inthiscontext.@Nullable org.aya.syntax.ref.AnyVargetQualifiedLocalMaybe(org.aya.syntax.concrete.stmt.ModuleName.Qualified modName, @NotNull String name, @NotNull org.aya.util.error.SourcePos sourcePos) Trying to get a symbol by qualified id{modName}::{name}inthiscontext@Nullable org.aya.syntax.ref.LocalVargetUnqualifiedLocalMaybe(@NotNull String name, @NotNull org.aya.util.error.SourcePos sourcePos) Trying to get a symbol by unqualified name inthiscontext.final inthashCode()Returns a hash code value for this object.@NotNull Stringname()Returns the value of thenamerecord component.@NotNull Contextparent()Returns the value of theparentrecord component.@NotNull org.aya.syntax.ref.LocalVarref()Returns the value of therefrecord component.@NotNull org.aya.util.reporter.Reporterreporter()final StringtoString()Returns a string representation of this record class.@NotNull PathMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.aya.resolve.context.Context
bind, bind, bind, derive, derive, get, getMaybe, getModuleMaybe, getQualified, getQualifiedMaybe, getUnqualified, getUnqualifiedMaybe, iterate, modulePath, reportAll, reportAllAndThrow, reportAndThrowMethods inherited from interface org.aya.tyck.tycker.Problematic
fail, fail, fail
-
Constructor Details
-
BindContext
public BindContext(@NotNull @NotNull Context parent, @NotNull @NotNull String name, @NotNull @NotNull org.aya.syntax.ref.LocalVar ref) Creates an instance of aBindContextrecord class.- Parameters:
parent- the value for theparentrecord componentname- the value for thenamerecord componentref- the value for therefrecord component
-
-
Method Details
-
parent
Returns the value of theparentrecord component. -
reporter
@NotNull public @NotNull org.aya.util.reporter.Reporter reporter()- Specified by:
reporterin interfaceContext- Specified by:
reporterin interfaceProblematic
-
underlyingFile
- Specified by:
underlyingFilein interfaceContext
-
collect
public kala.collection.mutable.MutableList<org.aya.syntax.ref.LocalVar> collect(@NotNull @NotNull kala.collection.mutable.MutableList<org.aya.syntax.ref.LocalVar> container) -
getUnqualifiedLocalMaybe
@Nullable public @Nullable org.aya.syntax.ref.LocalVar getUnqualifiedLocalMaybe(@NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos) Description copied from interface:ContextTrying to get a symbol by unqualified name inthiscontext.- Specified by:
getUnqualifiedLocalMaybein interfaceContext
-
getQualifiedLocalMaybe
@Nullable public @Nullable org.aya.syntax.ref.AnyVar getQualifiedLocalMaybe(@NotNull org.aya.syntax.concrete.stmt.ModuleName.Qualified modName, @NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos) Description copied from interface:ContextTrying to get a symbol by qualified id{modName}::{name}inthiscontext- Specified by:
getQualifiedLocalMaybein interfaceContext- Returns:
- a symbol in component , even it is
ModuleName.This; null if not found
-
getModuleLocalMaybe
@Nullable public @Nullable ModuleExport getModuleLocalMaybe(@NotNull org.aya.syntax.concrete.stmt.ModuleName.Qualified modName) Description copied from interface:ContextTrying to get aModuleExportby a module inthiscontext.- Specified by:
getModuleLocalMaybein interfaceContext- Parameters:
modName- qualified module name- Returns:
- a ModuleExport of that module; null if no such module.
-
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. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
ref
@NotNull public @NotNull org.aya.syntax.ref.LocalVar ref()Returns the value of therefrecord component.- Returns:
- the value of the
refrecord component
-