Skip to content

Commit

Permalink
refactor: rename hidden type
Browse files Browse the repository at this point in the history
  • Loading branch information
4e6 committed Feb 6, 2025
1 parent cd7ae28 commit ffb1fe2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ object Runtime {
/** The type of the expression.
*
* @param visibleType the public type of the expression visible to the user
* @param conversionType the available conversions
* @param hiddenType the list of types this expression can be converted to
*/
case class ExpressionType(
visibleType: Vector[String],
conversionType: Vector[String]
hiddenType: Vector[String]
)

/** A representation of an executable position in code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* represents a simple type.
*
* @param visibleType the public type of the value visible to the user
* @param conversionTypes the available conversions
* @param hiddenType the list of types the value can be converted to
*/
public record TypeInfo(String[] visibleType, String[] conversionTypes) {
public record TypeInfo(String[] visibleType, String[] hiddenType) {

public static TypeInfo ofType(String typeName) {
return new TypeInfo(new String[] {typeName}, new String[] {});
Expand All @@ -26,7 +26,7 @@ public String toString() {
return "TypeInfo("
+ Arrays.toString(visibleType)
+ ","
+ Arrays.toString(conversionTypes)
+ Arrays.toString(hiddenType)
+ ")";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -787,21 +787,21 @@ public boolean wasCached() {
*/
public boolean isTypeChanged() {
String[] visibleType = null;
String[] hiddenTypes = null;
String[] hiddenType = null;
if (typeInfo != null) {
visibleType = typeInfo.visibleType();
hiddenTypes = typeInfo.conversionTypes();
hiddenType = typeInfo.hiddenType();
}

String[] cachedVisibleType = null;
String[] cachedHiddenTypes = null;
String[] cachedHiddenType = null;
if (cachedTypeInfo != null) {
cachedVisibleType = cachedTypeInfo.visibleType();
cachedHiddenTypes = cachedTypeInfo.conversionTypes();
cachedHiddenType = cachedTypeInfo.hiddenType();
}

return !Arrays.equals(visibleType, cachedVisibleType)
|| !Arrays.equals(hiddenTypes, cachedHiddenTypes);
|| !Arrays.equals(hiddenType, cachedHiddenType);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ object ProgramExecutionSupport {
private def toExpressionType(typeInfo: TypeInfo): Api.ExpressionType =
Api.ExpressionType(
typeInfo.visibleType().toVector,
typeInfo.conversionTypes().toVector
typeInfo.hiddenType().toVector
)

/** Find source file path by the module name.
Expand Down

0 comments on commit ffb1fe2

Please sign in to comment.