Skip to content

Commit

Permalink
test: promote test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Apr 25, 2023
1 parent 935d356 commit 37aa34f
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
41 changes: 41 additions & 0 deletions test/class_types_3_dot_8.t/input.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */

[@reason.version 3.8];

class type _module ('provider_impl) = {

};
type t;
class type bzz = {
inherit _module(t)
};

class type t = { as 'a;
constraint 'a = #s
};

/* https://github.com/facebook/reason/issues/2037 */
class type xt = { as 'a };

class x = {
as self
};

class type classWithNoArgType {
pub x : int;
pub y : int
};

class classWithNoArg {
pub x = 0;
pub y = 0
};

class type t = {
open M;
as 'a;
};

class type t = {
open M;
};
18 changes: 18 additions & 0 deletions test/class_types_3_dot_8.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

Format basic
$ refmt --print re ./input.re > ./formatted.re

Type-check basics
$ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re
File "formatted.re", line 13, characters 19-20:
13 | constraint 'a = #s;
^
Error: Unbound class type s
[2]
Format the formatted file back
$ refmt --print re ./formatted.re > ./formatted_back.re
Ensure idempotency: first format and second format are the same
$ diff formatted.re formatted_back.re

0 comments on commit 37aa34f

Please sign in to comment.