Skip to content

Commit 6feb00b

Browse files
committed
rejig: .proto ordering + names
1 parent c98455c commit 6feb00b

File tree

2 files changed

+25
-26
lines changed

2 files changed

+25
-26
lines changed

lambda-buffers-compiler/src/LambdaBuffers/Compiler/ProtoCompat/FromProto.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -676,13 +676,13 @@ instance IsMessage P.KindCheckError PC.KindCheckError where
676676
<$> fromProto (err ^. P.tyDef)
677677
<*> fromProto (err ^. P.tyRef)
678678
<*> fromProto (err ^. P.moduleName)
679-
P.KindCheckError'ImpossibleUnificationError' err ->
679+
P.KindCheckError'UnificationError' err ->
680680
PC.IncorrectApplicationError
681681
<$> fromProto (err ^. P.tyDef)
682682
<*> fromProto (err ^. P.tyKindLhs)
683683
<*> fromProto (err ^. P.tyKindRhs)
684684
<*> fromProto (err ^. P.moduleName)
685-
P.KindCheckError'RecursiveKindError' err ->
685+
P.KindCheckError'CyclicKindError' err ->
686686
PC.RecursiveKindError
687687
<$> fromProto (err ^. P.tyDef)
688688
<*> fromProto (err ^. P.moduleName)
@@ -707,14 +707,14 @@ instance IsMessage P.KindCheckError PC.KindCheckError where
707707
& (P.unboundTyRefError . P.moduleName) .~ toProto modname
708708
PC.IncorrectApplicationError tydef k1 k2 modname ->
709709
defMessage
710-
& (P.impossibleUnificationError . P.tyDef) .~ toProto tydef
711-
& (P.impossibleUnificationError . P.tyKindLhs) .~ toProto k1
712-
& (P.impossibleUnificationError . P.tyKindRhs) .~ toProto k2
713-
& (P.impossibleUnificationError . P.moduleName) .~ toProto modname
710+
& (P.unificationError . P.tyDef) .~ toProto tydef
711+
& (P.unificationError . P.tyKindLhs) .~ toProto k1
712+
& (P.unificationError . P.tyKindRhs) .~ toProto k2
713+
& (P.unificationError . P.moduleName) .~ toProto modname
714714
PC.RecursiveKindError tydef modname ->
715715
defMessage
716-
& (P.recursiveKindError . P.tyDef) .~ toProto tydef
717-
& (P.recursiveKindError . P.moduleName) .~ toProto modname
716+
& (P.cyclicKindError . P.tyDef) .~ toProto tydef
717+
& (P.cyclicKindError . P.moduleName) .~ toProto modname
718718
PC.InconsistentTypeError tydef ki kd modname ->
719719
defMessage
720720
& (P.inconsistentTypeError . P.tyDef) .~ toProto tydef

lambda-buffers-proto/compiler.proto

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -645,9 +645,9 @@ message KindCheckError {
645645

646646
// Unbound type reference ty_ref detected in term ty_def.
647647
message UnboundTyRefError {
648-
TyDef ty_def = 1;
649-
TyRef ty_ref = 2;
650-
ModuleName module_name = 3;
648+
ModuleName module_name = 1;
649+
TyDef ty_def = 2;
650+
TyRef ty_ref = 3;
651651
}
652652

653653
// In ty_def an error has occurred when trying to unify kind ty_kind_lhs
@@ -656,35 +656,34 @@ message KindCheckError {
656656
// FIXME(cstml): Add source of constraint to the error such that user can see
657657
// where the constraint was generated - therefore where the error precisely
658658
// is.
659-
message ImpossibleUnificationError {
660-
TyDef ty_def = 1;
661-
Kind ty_kind_lhs = 2;
662-
Kind ty_kind_rhs = 3;
663-
ModuleName module_name = 4;
659+
message UnificationError {
660+
ModuleName module_name = 1;
661+
TyDef ty_def = 2;
662+
Kind ty_kind_lhs = 3;
663+
Kind ty_kind_rhs = 4;
664664
}
665665

666-
// A cyclic term was encountered. Infinite terms like this are not acceptable,
667-
// and we do not support them. We could not construct infinite "a = ty_name a"
668-
// error.
669-
message RecursiveKindError {
666+
// A cyclic kind was encountered. Infinite kinds like this are not acceptable,
667+
// and we do not support them. We could not construct infinite kind in ty_def.
668+
message CyclicKindError {
670669
TyDef ty_def = 1;
671670
ModuleName module_name = 2;
672671
}
673672

674673
// The actual_kind differs from the expected_kind.
675674
message InconsistentTypeError {
676-
TyDef ty_def = 1;
677-
Kind actual_kind = 2;
678-
Kind expected_kind = 3;
679-
ModuleName module_name = 4;
675+
ModuleName module_name = 1;
676+
TyDef ty_def = 2;
677+
Kind actual_kind = 3;
678+
Kind expected_kind = 4;
680679
}
681680

682681
// One of the errors occurred during kind checking.
683682
oneof kind_check_error {
684683
UnboundTyRefError unbound_ty_ref_error = 1;
685684
UnboundTyVarError unbound_ty_var_error = 2;
686-
ImpossibleUnificationError impossible_unification_error = 3;
687-
RecursiveKindError recursive_kind_error = 4;
685+
UnificationError unification_error = 3;
686+
CyclicKindError cyclic_kind_error = 4;
688687
InconsistentTypeError inconsistent_type_error = 5;
689688
}
690689
}

0 commit comments

Comments
 (0)