Skip to content

Commit

Permalink
update test repo with modules
Browse files Browse the repository at this point in the history
Summary: This is a test repo that we use from our skycastle workflow. Just added a few more files containing new modules constructs

Reviewed By: malanka

Differential Revision: D37852740

fbshipit-source-id: 0d9c7ada03810ffa59c757fdfde45f91cfeb05a5
  • Loading branch information
Philippe Bidinger authored and facebook-github-bot committed Jul 14, 2022
1 parent 999edc2 commit 0381be5
Showing 8 changed files with 90 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hphp/hack/test/integration/data/simple_repo/.hhconfig
Original file line number Diff line number Diff line change
@@ -7,3 +7,6 @@ disallow_fun_and_cls_meth_pseudo_funcs = true

auto_namespace_map = {"Herp": "Derp\\Lib\\Herp"}
disable_xhp_element_mangling = false

allowed_files_for_module_declarations = modules.php, modules_ns.php

4 changes: 4 additions & 0 deletions hphp/hack/test/integration/data/simple_repo/Attribute.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?hh // strict

class Attribute implements HH\ModuleAttribute {
}
25 changes: 25 additions & 0 deletions hphp/hack/test/integration/data/simple_repo/ClassBar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?hh // strict
<<file: __EnableUnstableFeatures('modules')>>

module bar;

internal class CI {
internal int $x = 0;
static internal int $y = 0;
}

abstract class X {
abstract internal function foo(): CI;
}

class Y {
internal function foo(): CI {
return new CI();
}

public function foobar(): void {
}

static internal function barfoo(): void {
}
}
8 changes: 8 additions & 0 deletions hphp/hack/test/integration/data/simple_repo/ClassFoo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?hh // strict
<<file: __EnableUnstableFeatures('modules')>>

module foo;

internal class ClassFoo {

}
8 changes: 8 additions & 0 deletions hphp/hack/test/integration/data/simple_repo/ClassFooNS.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?hh // strict
<<file: __EnableUnstableFeatures('modules')>>

module fooNS;

class ClassFooNS {

}
28 changes: 28 additions & 0 deletions hphp/hack/test/integration/data/simple_repo/Members.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?hh // strict
<<file: __EnableUnstableFeatures('modules')>>

module foo;

newtype N = int;

internal newtype NI = int;

trait T {
}

internal trait TI {
}

interface I {
}

internal interface II {
}

enum E: int {
Red = 3;
}

internal enum EI: int {
Red = 3;
}
7 changes: 7 additions & 0 deletions hphp/hack/test/integration/data/simple_repo/modules.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?hh // strict
<<file: __EnableUnstableFeatures('modules')>>


<<Attribute>>
new module foo {}
new module bar {}
7 changes: 7 additions & 0 deletions hphp/hack/test/integration/data/simple_repo/modules_ns.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?hh // strict
<<file: __EnableUnstableFeatures('modules')>>

// namespace don't apply to modules
namespace SomeNS;

new module fooNS {}

0 comments on commit 0381be5

Please sign in to comment.