Skip to content

lal_refactor-extract_variable: Add qualified Ada_Op'(Node.As_Bin_Op.F_Op) #2

@andrewathalye

Description

@andrewathalye

Applying the attached patch to lal_refactor-extract_variable.adb resolves an error "selecting expression of general case statement is ambiguous" when trying to compile the file.

diff --git a/src/lal_refactor-extract_variable.adb b/src/lal_refactor-extract_variable.adb.new
index 2a3c256..49533d0 100644
--- a/src/lal_refactor-extract_variable.adb
+++ b/src/lal_refactor-extract_variable.adb.new
@@ -77,7 +77,7 @@ package body LAL_Refactor.Extract_Variable is
 
          function Get_Priority (Node : Ada_Node) return Natural is
          begin
-            case Node.As_Bin_Op.F_Op is
+            case Ada_Op'(Node.As_Bin_Op.F_Op) is
                when Ada_Op_In | Ada_Op_Not_In =>
                   return 7;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions