Skip to content

Commit

Permalink
fix negative tests & formatiing
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Oct 19, 2023
1 parent e5f603b commit 0e1d18f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Juvix/Compiler/Concrete/Print/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ instance (SingI s) => PrettyPrint (SigArg s) where
ppFunctionSignature :: (SingI s) => PrettyPrinting (FunctionDef s)
ppFunctionSignature FunctionDef {..} = do
let termin' = (<> line) . ppCode <$> _signTerminating
coercion' = (<> line) . ppCode <$> _signCoercion
coercion' = (<> if isJust instance' then space else line) . ppCode <$> _signCoercion
instance' = (<> line) . ppCode <$> _signInstance
args' = hsep . fmap ppCode <$> nonEmpty _signArgs
builtin' = (<> line) . ppCode <$> _signBuiltin
Expand Down
4 changes: 2 additions & 2 deletions tests/negative/Internal/AmbiguousCoercions.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ unitT1 : T1 Unit := mkT1 (pp := λ{_ := unit});
instance
unitT2 : T2 Unit := mkT2 (pp := λ{_ := unit});

coercion
coercion instance
fromT1toT {A} {{T1 A}} : T A := mkT@{
pp := T1.pp
};

coercion
coercion instance
fromT2toT {A} {{T2 A}} : T A := mkT@{
pp := T2.pp
};
Expand Down
2 changes: 1 addition & 1 deletion tests/negative/Internal/CoercionTargetNotATrait.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ type T A := mkT {a : A};

type Maybe A := just A | nothing;

coercion
coercion instance
inst {A} {{T A}} : Maybe A := nothing;
2 changes: 1 addition & 1 deletion tests/negative/Internal/InvalidCoercionType.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module InvalidCoercionType;
trait
type T A := mkT {pp : A -> A};

coercion
coercion instance
coe {A} : T A :=
mkT@{
pp (x : A) : A := x
Expand Down
4 changes: 2 additions & 2 deletions tests/negative/Internal/LoopingCoercion.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ type T1 A := mkT1 {pp : A -> A};
trait
type T2 A := mkT2 {pp : A -> A};

coercion
coercion instance
fromT1toT2 {A} {{T1 A}} : T2 A := mkT2@{
pp := T1.pp
};

coercion
coercion instance
fromT2toT1 {A} {{T2 A}} : T1 A := mkT1@{
pp := T2.pp
};
Expand Down
2 changes: 1 addition & 1 deletion tests/negative/Internal/WrongCoercionArgument.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type T1 A := mkT1 {pp : A -> A};
trait
type T2 A := mkT2 {pp : A -> A};

coercion
coercion instance
coe {A} {{T1 A}} {{T1 A}} : T2 A :=
mkT2@{
pp := T1.pp
Expand Down

0 comments on commit 0e1d18f

Please sign in to comment.