From 987585383741a8dd71b37310c5e50f9c6646c653 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 4 Dec 2023 14:02:56 +0100 Subject: [PATCH] fix ptyp_alias Signed-off-by: Paul-Elliot --- astlib/ast_502.ml | 2 +- astlib/migrate_501_502.ml | 2 +- astlib/migrate_502_501.ml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/astlib/ast_502.ml b/astlib/ast_502.ml index 7766f208b..9842c6445 100644 --- a/astlib/ast_502.ml +++ b/astlib/ast_502.ml @@ -147,7 +147,7 @@ module Parsetree = struct - [T #tconstr] when [l=[T]], - [(T1, ..., Tn) #tconstr] when [l=[T1 ; ... ; Tn]]. *) - | Ptyp_alias of core_type * string (** [T as 'a]. *) + | Ptyp_alias of core_type * string loc (** [T as 'a]. *) | Ptyp_variant of row_field list * closed_flag * label list option (** [Ptyp_variant([`A;`B], flag, labels)] represents: - [[ `A|`B ]] diff --git a/astlib/migrate_501_502.ml b/astlib/migrate_501_502.ml index fc74b1c2d..cad78770b 100644 --- a/astlib/migrate_501_502.ml +++ b/astlib/migrate_501_502.ml @@ -440,7 +440,7 @@ and copy_core_type_desc : Ast_502.Parsetree.Ptyp_class (copy_loc copy_Longident_t x0, List.map copy_core_type x1) | Ast_501.Parsetree.Ptyp_alias (x0, x1) -> - Ast_502.Parsetree.Ptyp_alias (copy_core_type x0, x1) + Ast_502.Parsetree.Ptyp_alias (copy_core_type x0, Ast_502.Parsetree.{ txt = x1; loc = Location.none } ) | Ast_501.Parsetree.Ptyp_variant (x0, x1, x2) -> Ast_502.Parsetree.Ptyp_variant ( List.map copy_row_field x0, diff --git a/astlib/migrate_502_501.ml b/astlib/migrate_502_501.ml index 1c131ebbb..cd7073411 100644 --- a/astlib/migrate_502_501.ml +++ b/astlib/migrate_502_501.ml @@ -436,7 +436,7 @@ and copy_core_type_desc loc : Ast_501.Parsetree.Ptyp_class (copy_loc copy_Longident_t x0, List.map copy_core_type x1) | Ast_502.Parsetree.Ptyp_alias (x0, x1) -> - Ast_501.Parsetree.Ptyp_alias (copy_core_type x0, x1) + Ast_501.Parsetree.Ptyp_alias (copy_core_type x0, x1.txt) | Ast_502.Parsetree.Ptyp_variant (x0, x1, x2) -> Ast_501.Parsetree.Ptyp_variant ( List.map copy_row_field x0,