-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
935d356
commit 37aa34f
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||