diff options
author | Son Ho | 2023-11-24 17:10:05 +0100 |
---|---|---|
committer | Son Ho | 2023-11-24 17:10:05 +0100 |
commit | 5b9f8de676829817d2b776166fda66bfb5128d6c (patch) | |
tree | fd6b73e1a0f5e8c916b2f58ce1afe5bde6e4838a | |
parent | 1b446285bbbe356ead7c0e521799b35020f08147 (diff) |
Improve the error messages for some name collisions
Diffstat (limited to '')
-rw-r--r-- | compiler/ExtractBase.ml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/ExtractBase.ml b/compiler/ExtractBase.ml index c6158847..dffe1ea3 100644 --- a/compiler/ExtractBase.ml +++ b/compiler/ExtractBase.ml @@ -634,11 +634,13 @@ let id_to_string (id : id) (ctx : extraction_ctx) : string = | TypeId id -> "type name: " ^ type_id_to_string ctx id | StructId id -> "struct constructor of: " ^ type_id_to_string ctx id | VariantId (id, variant_id) -> + let type_name = type_id_to_string ctx id in let variant_name = adt_variant_to_string ctx id (Some variant_id) in - "variant name: " ^ variant_name + "type name: " ^ type_name ^ ", variant name: " ^ variant_name | FieldId (id, field_id) -> + let type_name = type_id_to_string ctx id in let field_name = adt_field_to_string ctx id field_id in - "field name: " ^ field_name + "type name: " ^ type_name ^ ", field name: " ^ field_name | UnknownId -> "keyword" | TypeVarId id -> "type_var_id: " ^ TypeVarId.to_string id | ConstGenericVarId id -> |