From ffb1fe2ad89670149e4ecabd1b8d8422343c3f05 Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Thu, 6 Feb 2025 16:48:35 +0000 Subject: [PATCH] refactor: rename hidden type --- .../main/scala/org/enso/polyglot/runtime/Runtime.scala | 4 ++-- .../java/org/enso/interpreter/instrument/TypeInfo.java | 6 +++--- .../org/enso/interpreter/service/ExecutionService.java | 10 +++++----- .../instrument/job/ProgramExecutionSupport.scala | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/engine/polyglot-api/src/main/scala/org/enso/polyglot/runtime/Runtime.scala b/engine/polyglot-api/src/main/scala/org/enso/polyglot/runtime/Runtime.scala index 42c4537c22fe7..9f8768a77925b 100644 --- a/engine/polyglot-api/src/main/scala/org/enso/polyglot/runtime/Runtime.scala +++ b/engine/polyglot-api/src/main/scala/org/enso/polyglot/runtime/Runtime.scala @@ -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. diff --git a/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/instrument/TypeInfo.java b/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/instrument/TypeInfo.java index 42ce414d0cc9f..3a91ee433d046 100644 --- a/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/instrument/TypeInfo.java +++ b/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/instrument/TypeInfo.java @@ -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[] {}); @@ -26,7 +26,7 @@ public String toString() { return "TypeInfo(" + Arrays.toString(visibleType) + "," - + Arrays.toString(conversionTypes) + + Arrays.toString(hiddenType) + ")"; } } diff --git a/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/service/ExecutionService.java b/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/service/ExecutionService.java index c3bf4d0c5fd51..3dc436734518f 100644 --- a/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/service/ExecutionService.java +++ b/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/service/ExecutionService.java @@ -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); } /** diff --git a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/ProgramExecutionSupport.scala b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/ProgramExecutionSupport.scala index 1db0fcb294a7d..c1291ce6b7ddf 100644 --- a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/ProgramExecutionSupport.scala +++ b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/ProgramExecutionSupport.scala @@ -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.