diff --git a/compiler/gentype/GenTypeMain.ml b/compiler/gentype/GenTypeMain.ml index fc5091d6d8..54f9923542 100644 --- a/compiler/gentype/GenTypeMain.ml +++ b/compiler/gentype/GenTypeMain.ml @@ -135,7 +135,7 @@ let process_cmt_file cmt = Log_.Color.setup (); Log_.info ~loc ~name:"Warning genType" (fun ppf () -> Format.fprintf ppf - "Annotation is ignored as there's a .rei file")); + "Annotation is ignored as there's a .resi file")); true) else false) in diff --git a/tests/gentype_tests/typescript-react-example/src/ImmutableArray.res b/tests/gentype_tests/typescript-react-example/src/ImmutableArray.res index 328e9f0cd1..458f61767b 100644 --- a/tests/gentype_tests/typescript-react-example/src/ImmutableArray.res +++ b/tests/gentype_tests/typescript-react-example/src/ImmutableArray.res @@ -43,15 +43,12 @@ module Array = { let rangeBy = (x, y, ~step) => Array.rangeBy(x, y, ~step)->toT - let makeByU = (c, f) => Array.makeByU(c, f)->toT let makeBy = (c, f) => Array.makeBy(c, x => f(x))->toT - let makeByAndShuffleU = (c, f) => Array.makeByAndShuffleU(c, f)->toT let makeByAndShuffle = (c, f) => Array.makeByAndShuffle(c, x => f(x))->toT let zip = (a1, a2) => Array.zip(fromT(a1), fromT(a2))->toTp - let zipByU = (a1, a2, f) => Array.zipByU(fromT(a1), fromT(a2), f)->toT let zipBy = (a1, a2, f) => Array.zipBy(fromT(a1), fromT(a2), (x, y) => f(x, y))->toT let unzip = a => Array.unzip(a->fromTp)->toT2 @@ -66,53 +63,37 @@ module Array = { let copy = a => Array.copy(a->fromT)->toT - let forEachU = (a, f) => Array.forEachU(a->fromT, f) let forEach = (a, f) => Array.forEach(a->fromT, x => f(x)) - let mapU = (a, f) => Array.mapU(a->fromT, f)->toT let map = (a, f) => Array.map(a->fromT, x => f(x))->toT - let keepWithIndexU = (a, f) => Array.keepWithIndexU(a->fromT, f)->toT let keepWithIndex = (a, f) => Array.keepWithIndex(a->fromT, (x, y) => f(x, y))->toT - let keepMapU = (a, f) => Array.keepMapU(a->fromT, f)->toT let keepMap = (a, f) => Array.keepMap(a->fromT, x => f(x))->toT - let forEachWithIndexU = (a, f) => Array.forEachWithIndexU(a->fromT, f) let forEachWithIndex = (a, f) => Array.forEachWithIndex(a->fromT, (x, y) => f(x, y)) - let mapWithIndexU = (a, f) => Array.mapWithIndexU(a->fromT, f)->toT let mapWithIndex = (a, f) => Array.mapWithIndex(a->fromT, (x, y) => f(x, y))->toT - let partitionU = (a, f) => Array.partitionU(a->fromT, f)->toT2 let partition = (a, f) => Array.partition(a->fromT, x => f(x))->toT2 - let reduceU = (a, b, f) => Array.reduceU(a->fromT, b, f) let reduce = (a, b, f) => Array.reduce(a->fromT, b, (x, y) => f(x, y)) - let reduceReverseU = (a, b, f) => Array.reduceReverseU(a->fromT, b, f) let reduceReverse = (a, b, f) => Array.reduceReverse(a->fromT, b, (x, y) => f(x, y)) - let reduceReverse2U = (a1, a2, c, f) => Array.reduceReverse2U(fromT(a1), fromT(a2), c, f) let reduceReverse2 = (a1, a2, c, f) => Array.reduceReverse2(fromT(a1), fromT(a2), c, (x, y, z) => f(x, y, z)) - let someU = (a, f) => Array.someU(a->fromT, f) let some = (a, f) => Array.some(a->fromT, x => f(x)) - let everyU = (a, f) => Array.everyU(a->fromT, f) let every = (a, f) => Array.every(a->fromT, x => f(x)) - let every2U = (a1, a2, f) => Array.every2U(fromT(a1), fromT(a2), f) let every2 = (a1, a2, f) => Array.every2(fromT(a1), fromT(a2), (x, y) => f(x, y)) - let some2U = (a1, a2, f) => Array.some2U(fromT(a1), fromT(a2), f) let some2 = (a1, a2, f) => Array.some2(fromT(a1), fromT(a2), (x, y) => f(x, y)) - let cmpU = (a1, a2, f) => Array.cmpU(fromT(a1), fromT(a2), f) let cmp = (a1, a2, f) => Array.cmp(fromT(a1), fromT(a2), (x, y) => f(x, y)) - let eqU = (a1, a2, f) => Array.eqU(fromT(a1), fromT(a2), f) let eq = (a1, a2, f) => Array.eq(fromT(a1), fromT(a2), (x, y) => f(x, y)) } diff --git a/tests/gentype_tests/typescript-react-example/src/ImmutableArray.res.js b/tests/gentype_tests/typescript-react-example/src/ImmutableArray.res.js index d056c1477f..157f4fd10c 100644 --- a/tests/gentype_tests/typescript-react-example/src/ImmutableArray.res.js +++ b/tests/gentype_tests/typescript-react-example/src/ImmutableArray.res.js @@ -48,22 +48,16 @@ let range = Belt_Array.range; let rangeBy = Belt_Array.rangeBy; -let makeByU = Belt_Array.makeByU; - function makeBy(c, f) { return Belt_Array.makeBy(c, x => f(x)); } -let makeByAndShuffleU = Belt_Array.makeByAndShuffleU; - function makeByAndShuffle(c, f) { return Belt_Array.makeByAndShuffle(c, x => f(x)); } let zip = Belt_Array.zip; -let zipByU = Belt_Array.zipByU; - function zipBy(a1, a2, f) { return Belt_Array.zipBy(a1, a2, (x, y) => f(x, y)); } @@ -82,98 +76,66 @@ function copy(a) { return a.slice(0); } -let forEachU = Belt_Array.forEachU; - function forEach(a, f) { Belt_Array.forEach(a, x => f(x)); } -let mapU = Belt_Array.mapU; - function map(a, f) { return Belt_Array.map(a, x => f(x)); } -let keepWithIndexU = Belt_Array.keepWithIndexU; - function keepWithIndex(a, f) { return Belt_Array.keepWithIndex(a, (x, y) => f(x, y)); } -let keepMapU = Belt_Array.keepMapU; - function keepMap(a, f) { return Belt_Array.keepMap(a, x => f(x)); } -let forEachWithIndexU = Belt_Array.forEachWithIndexU; - function forEachWithIndex(a, f) { Belt_Array.forEachWithIndex(a, (x, y) => f(x, y)); } -let mapWithIndexU = Belt_Array.mapWithIndexU; - function mapWithIndex(a, f) { return Belt_Array.mapWithIndex(a, (x, y) => f(x, y)); } -let partitionU = Belt_Array.partitionU; - function partition(a, f) { return Belt_Array.partition(a, x => f(x)); } -let reduceU = Belt_Array.reduceU; - function reduce(a, b, f) { return Belt_Array.reduce(a, b, (x, y) => f(x, y)); } -let reduceReverseU = Belt_Array.reduceReverseU; - function reduceReverse(a, b, f) { return Belt_Array.reduceReverse(a, b, (x, y) => f(x, y)); } -let reduceReverse2U = Belt_Array.reduceReverse2U; - function reduceReverse2(a1, a2, c, f) { return Belt_Array.reduceReverse2(a1, a2, c, (x, y, z) => f(x, y, z)); } -let someU = Belt_Array.someU; - function some(a, f) { return Belt_Array.some(a, x => f(x)); } -let everyU = Belt_Array.everyU; - function every(a, f) { return Belt_Array.every(a, x => f(x)); } -let every2U = Belt_Array.every2U; - function every2(a1, a2, f) { return Belt_Array.every2(a1, a2, (x, y) => f(x, y)); } -let some2U = Belt_Array.some2U; - function some2(a1, a2, f) { return Belt_Array.some2(a1, a2, (x, y) => f(x, y)); } -let cmpU = Belt_Array.cmpU; - function cmp(a1, a2, f) { return Belt_Array.cmp(a1, a2, (x, y) => f(x, y)); } -let eqU = Belt_Array.eqU; - function eq(a1, a2, f) { return Belt_Array.eq(a1, a2, (x, y) => f(x, y)); } @@ -199,12 +161,9 @@ export { make, range, rangeBy, - makeByU, makeBy, - makeByAndShuffleU, makeByAndShuffle, zip, - zipByU, zipBy, unzip, concat, @@ -212,37 +171,21 @@ export { slice, sliceToEnd, copy, - forEachU, forEach, - mapU, map, - keepWithIndexU, keepWithIndex, - keepMapU, keepMap, - forEachWithIndexU, forEachWithIndex, - mapWithIndexU, mapWithIndex, - partitionU, partition, - reduceU, reduce, - reduceReverseU, reduceReverse, - reduceReverse2U, reduceReverse2, - someU, some, - everyU, every, - every2U, every2, - some2U, some2, - cmpU, cmp, - eqU, eq, } /* No side effect */ diff --git a/tests/gentype_tests/typescript-react-example/src/ImmutableArray.resi b/tests/gentype_tests/typescript-react-example/src/ImmutableArray.resi index 133a8c97be..adef7af76a 100644 --- a/tests/gentype_tests/typescript-react-example/src/ImmutableArray.resi +++ b/tests/gentype_tests/typescript-react-example/src/ImmutableArray.resi @@ -38,15 +38,12 @@ let range: (int, int) => t let rangeBy: (int, int, ~step: int) => t -let makeByU: (int, int => 'a) => t<'a> let makeBy: (int, int => 'a) => t<'a> -let makeByAndShuffleU: (int, int => 'a) => t<'a> let makeByAndShuffle: (int, int => 'a) => t<'a> let zip: (t<'a>, t<'b>) => t<('a, 'b)> -let zipByU: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c> let zipBy: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c> let unzip: t<('a, 'a)> => (t<'a>, t<'a>) @@ -61,50 +58,34 @@ let sliceToEnd: (t<'a>, int) => t<'a> let copy: t<'a> => t<'a> -let forEachU: (t<'a>, 'a => unit) => unit let forEach: (t<'a>, 'a => unit) => unit -let mapU: (t<'a>, 'a => 'b) => t<'b> let map: (t<'a>, 'a => 'b) => t<'b> -let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a> let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a> -let keepMapU: (t<'a>, 'a => option<'b>) => t<'b> let keepMap: (t<'a>, 'a => option<'b>) => t<'b> -let forEachWithIndexU: (t<'a>, (int, 'a) => unit) => unit let forEachWithIndex: (t<'a>, (int, 'a) => unit) => unit -let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => t<'b> let mapWithIndex: (t<'a>, (int, 'a) => 'b) => t<'b> -let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>) let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>) -let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b -let reduceReverseU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b let reduceReverse: (t<'a>, 'b, ('b, 'a) => 'b) => 'b -let reduceReverse2U: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c let reduceReverse2: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c -let someU: (t<'a>, 'a => bool) => bool let some: (t<'a>, 'a => bool) => bool -let everyU: (t<'a>, 'a => bool) => bool let every: (t<'a>, 'a => bool) => bool -let every2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool let every2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool -let some2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool let some2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool -let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int -let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool diff --git a/tests/gentype_tests/typescript-react-example/src/nested/Types.res b/tests/gentype_tests/typescript-react-example/src/nested/Types.res index 4ca499ed6e..54fa80803c 100644 --- a/tests/gentype_tests/typescript-react-example/src/nested/Types.res +++ b/tests/gentype_tests/typescript-react-example/src/nested/Types.res @@ -49,7 +49,7 @@ type opaqueVariant = | A | B -@genType let stringT: String.t = "a" +@genType let stringT: string = "a" @genType let jsStringT: Js.String.t = "a"