Skip to content

Commit 30492e4

Browse files
committed
WIP: Demonstrate @genType issue with module aliasesgi
See #6112
1 parent fae27f7 commit 30492e4

File tree

8 files changed

+67
-0
lines changed

8 files changed

+67
-0
lines changed

jscomp/gentype_tests/typescript-react-example/src/MyModule.bs.js

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* TypeScript file generated from MyModule.res by genType. */
2+
/* eslint-disable import/first */
3+
4+
5+
// @ts-ignore: Implicit any on import
6+
import * as MyModuleBS__Es6Import from './MyModule.bs';
7+
const MyModuleBS: any = MyModuleBS__Es6Import;
8+
9+
// tslint:disable-next-line:interface-over-type-literal
10+
export type t = number;
11+
12+
export const add: (a:t, b:t) => t = MyModuleBS.add;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@genType
2+
type t = int
3+
4+
@genType
5+
let add = (a: t, b: t): t => a + b

jscomp/gentype_tests/typescript-react-example/src/Usage.bs.js

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* TypeScript file generated from Usage.res by genType. */
2+
/* eslint-disable import/first */
3+
4+
5+
// @ts-ignore: Implicit any on import
6+
import * as UsageBS__Es6Import from './Usage.bs';
7+
const UsageBS: any = UsageBS__Es6Import;
8+
9+
import type {MyModuleAlias_t as Wrapper_MyModuleAlias_t} from './Wrapper.gen';
10+
11+
export const b: Wrapper_MyModuleAlias_t = UsageBS.b;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
open Wrapper
2+
3+
let a = 5
4+
@genType
5+
let b = MyModuleAlias.add(a, 3)

jscomp/gentype_tests/typescript-react-example/src/Wrapper.bs.js

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module MyModuleAlias = MyModule

0 commit comments

Comments
 (0)