- 
                Notifications
    You must be signed in to change notification settings 
- Fork 334
Open
Labels
-compiler-libsLibraries: New libraries to be implementedLibraries: New libraries to be implemented-type-systemCategory: type system and type inferenceCategory: type system and type inferences-research-neededStatus: the task will require heavy research to completeStatus: the task will require heavy research to complete
Description
As discussed in #13273 - we could try to simplify the Column.is_column (and related DB_Column.is_database_column) checks to rely on case of or even is_a.
However, in practice that always ended up causing issues, so to not block big PRs I just kept whatever was working.
Still it may be worth investigating, because in principle is_a should indeed work and the fact that it doesn't hints at a possible issue with how we are working with the multi-types.
To reproduce the issue, just apply:
diff --git a/distribution/lib/Standard/Table/0.0.0-dev/src/Column.enso b/distribution/lib/Standard/Table/0.0.0-dev/src/Column.enso
--- a/distribution/lib/Standard/Table/0.0.0-dev/src/Column.enso	(revision ab2b6ba2484c681395ca7a42d61c1238553ea381)
+++ b/distribution/lib/Standard/Table/0.0.0-dev/src/Column.enso	(date 1750252587742)
@@ -67,10 +67,7 @@
 
     ## PRIVATE
        Checks if the given object represents a Column type.
-    is_column object -> Boolean =
-        Panic.catch Type_Error handler=_->False <|
-            _ = object:Column
-            True
+    is_column object -> Boolean = object.is_a Column
 
     ## PRIVATE
        ADVANCEDor alternatively
diff --git a/distribution/lib/Standard/Table/0.0.0-dev/src/Column.enso b/distribution/lib/Standard/Table/0.0.0-dev/src/Column.enso
--- a/distribution/lib/Standard/Table/0.0.0-dev/src/Column.enso	(revision ab2b6ba2484c681395ca7a42d61c1238553ea381)
+++ b/distribution/lib/Standard/Table/0.0.0-dev/src/Column.enso	(date 1750252587742)
@@ -67,10 +67,9 @@
 
     ## PRIVATE
        Checks if the given object represents a Column type.
-    is_column object -> Boolean =
-        Panic.catch Type_Error handler=_->False <|
-            _ = object:Column
-            True
+    is_column object -> Boolean = case object of
+        _ : Column -> True
+        _ -> False
 
     ## PRIVATE
        ADVANCEDEither one seems to cause test failures (in Database backends) like:
[FAILED] [SQLite File] Numeric_Column: [2/5, 435ms]
    - [FAILED] a numeric column supports abs operation [28ms]
        Reason: An unexpected dataflow error (Invalid_Value_Type.Value a numeric Mixed DB_Column X) has been matched (at Table_Tests\src\Common_Table_Operations\Numeric_Column_Spec.enso:49:13-62).
        at <enso> Value_Type_Helpers.raise_unexpected_type(C:\NBO\enso\built-distribution\enso-engine-0.0.0-dev-windows-amd64\enso-0.0.0-dev\lib\Standard\Table\0.0.0-dev\src\Internal\Value_Type_Helpers.enso:305:5-21)
Metadata
Metadata
Assignees
Labels
-compiler-libsLibraries: New libraries to be implementedLibraries: New libraries to be implemented-type-systemCategory: type system and type inferenceCategory: type system and type inferences-research-neededStatus: the task will require heavy research to completeStatus: the task will require heavy research to complete
Type
Projects
Status
❓New