This repository has been archived by the owner on Jul 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tempalte): list append-like operations should not affect types
- Loading branch information
Showing
27 changed files
with
210 additions
and
63 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 |
---|---|---|
@@ -1,13 +1,20 @@ | ||
import {Morphism} from '../ramda/dist/src/$types'; | ||
import * as R_adjust from '../ramda/dist/src/adjust'; | ||
|
||
declare const string_to_string: Morphism<string, string>; | ||
declare const string_to_number: Morphism<string, number>; | ||
declare const string_array: string[]; | ||
declare const number: number; | ||
|
||
// @dts-jest:pass -> (string | number)[] | ||
// @dts-jest:fail -> Argument of type 'Morphism<string, number>' is not assignable to parameter of type 'Morphism<string, string>'. | ||
R_adjust(string_to_number)(number, string_array); | ||
// @dts-jest:pass -> (string | number)[] | ||
// @dts-jest:fail -> Argument of type 'Morphism<string, number>' is not assignable to parameter of type 'Morphism<string, string>'. | ||
R_adjust(string_to_number, number)(string_array); | ||
// @dts-jest:pass -> (string | number)[] | ||
// @dts-jest:fail -> Argument of type 'Morphism<string, number>' is not assignable to parameter of type 'Morphism<string, string>'. | ||
R_adjust(string_to_number, number, string_array); | ||
// @dts-jest:pass -> string[] | ||
R_adjust(string_to_string)(number, string_array); | ||
// @dts-jest:pass -> string[] | ||
R_adjust(string_to_string, number)(string_array); | ||
// @dts-jest:pass -> string[] | ||
R_adjust(string_to_string, number, string_array); |
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 |
---|---|---|
@@ -1,9 +1,14 @@ | ||
import * as R_append from '../ramda/dist/src/append'; | ||
|
||
declare const string: string; | ||
declare const number: number; | ||
declare const number_array: number[]; | ||
|
||
// @dts-jest:pass -> (string | number)[] | ||
// @dts-jest:fail -> Argument of type 'number[]' is not assignable to parameter of type 'List<string>'. | ||
R_append(string)(number_array); | ||
// @dts-jest:pass -> (string | number)[] | ||
// @dts-jest:fail -> Argument of type 'number[]' is not assignable to parameter of type 'List<string>'. | ||
R_append(string, number_array); | ||
// @dts-jest:pass -> number[] | ||
R_append(number)(number_array); | ||
// @dts-jest:pass -> number[] | ||
R_append(number, number_array); |
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 |
---|---|---|
@@ -1,12 +1,20 @@ | ||
import * as R_insert from '../ramda/dist/src/insert'; | ||
|
||
declare const object: object; | ||
declare const object_array: object[]; | ||
declare const string: string; | ||
declare const number: number; | ||
|
||
// @dts-jest:pass -> <U>(list: U[] | ArrayLike<U>) => (string | U)[] | ||
// @dts-jest:pass -> (list: string[] | ArrayLike<string>) => string[] | ||
R_insert(number, string); | ||
// @dts-jest:pass -> (string | object)[] | ||
// @dts-jest:fail -> Argument of type 'object[]' is not assignable to parameter of type 'List<string>'. | ||
R_insert(number, string, object_array); | ||
// @dts-jest:pass -> (string | object)[] | ||
// @dts-jest:fail -> Argument of type 'object[]' is not assignable to parameter of type 'List<string>'. | ||
R_insert(number)(string)(object_array); | ||
|
||
// @dts-jest:pass -> (list: object[] | ArrayLike<object>) => object[] | ||
R_insert(number, object); | ||
// @dts-jest:pass -> object[] | ||
R_insert(number, object, object_array); | ||
// @dts-jest:pass -> object[] | ||
R_insert(number)(object)(object_array); |
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
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 |
---|---|---|
@@ -1,9 +1,14 @@ | ||
import * as R_prepend from '../ramda/dist/src/prepend'; | ||
|
||
declare const string: string; | ||
declare const number: number; | ||
declare const number_array: number[]; | ||
|
||
// @dts-jest:pass -> (string | number)[] | ||
// @dts-jest:fail -> Argument of type 'number[]' is not assignable to parameter of type 'List<string>'. | ||
R_prepend(string)(number_array); | ||
// @dts-jest:pass -> (string | number)[] | ||
// @dts-jest:fail -> Argument of type 'number[]' is not assignable to parameter of type 'List<string>'. | ||
R_prepend(string, number_array); | ||
// @dts-jest:pass -> number[] | ||
R_prepend(number)(number_array); | ||
// @dts-jest:pass -> number[] | ||
R_prepend(number, number_array); |
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
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import {List, Morphism} from './$types'; | ||
|
||
export function $<T, U>(fn: Morphism<T, U>, index: number, list: List<T>): (T | U)[]; | ||
export function $<T>(fn: Morphism<T, T>, index: number, list: List<T>): T[]; |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import {List} from './$types'; | ||
|
||
export function $<T, U>(value: T, list: List<U>): (T | U)[]; | ||
export function $<T>(value: T, list: List<T>): T[]; |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import {List} from './$types'; | ||
|
||
export function $<T, U>(index: number, value: T, list: List<U>): (T | U)[]; | ||
export function $<T>(index: number, value: T, list: List<T>): T[]; |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import {List} from './$types'; | ||
|
||
export function $<T, U>(index: number, values: List<T>, list: List<U>): (T | U)[]; | ||
export function $<T>(index: number, values: List<T>, list: List<T>): T[]; |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import {List} from './$types'; | ||
|
||
export function $<T, U>(value: T, list: List<U>): (T | U)[]; | ||
export function $<T>(value: T, list: List<T>): T[]; |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import {List} from './$types'; | ||
|
||
export function $<T, U>(index: number, value: T, list: List<U>): (T | U)[]; | ||
export function $<T>(index: number, value: T, list: List<T>): T[]; |
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 |
---|---|---|
@@ -1,7 +1,16 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`R_adjust(string_to_number)(number, string_array) 1`] = `"(string | number)[]"`; | ||
exports[`R_adjust(string_to_number)(number, string_array) 1`] = ` | ||
"Argument of type 'Morphism<string, number>' is not assignable to parameter of type 'Morphism<string, string>'. | ||
Type 'number' is not assignable to type 'string'." | ||
`; | ||
|
||
exports[`R_adjust(string_to_number, number)(string_array) 1`] = `"(string | number)[]"`; | ||
exports[`R_adjust(string_to_number, number)(string_array) 1`] = `"Argument of type 'Morphism<string, number>' is not assignable to parameter of type 'Morphism<string, string>'."`; | ||
|
||
exports[`R_adjust(string_to_number, number, string_array) 1`] = `"(string | number)[]"`; | ||
exports[`R_adjust(string_to_number, number, string_array) 1`] = `"Argument of type 'Morphism<string, number>' is not assignable to parameter of type 'Morphism<string, string>'."`; | ||
|
||
exports[`R_adjust(string_to_string)(number, string_array) 1`] = `"string[]"`; | ||
|
||
exports[`R_adjust(string_to_string, number)(string_array) 1`] = `"string[]"`; | ||
|
||
exports[`R_adjust(string_to_string, number, string_array) 1`] = `"string[]"`; |
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 |
---|---|---|
@@ -1,5 +1,17 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`R_append(string)(number_array) 1`] = `"(string | number)[]"`; | ||
exports[`R_append(number)(number_array) 1`] = `"number[]"`; | ||
|
||
exports[`R_append(string, number_array) 1`] = `"(string | number)[]"`; | ||
exports[`R_append(number, number_array) 1`] = `"number[]"`; | ||
|
||
exports[`R_append(string)(number_array) 1`] = ` | ||
"Argument of type 'number[]' is not assignable to parameter of type 'List<string>'. | ||
Type 'number[]' is not assignable to type 'ArrayLike<string>'. | ||
Index signatures are incompatible. | ||
Type 'number' is not assignable to type 'string'." | ||
`; | ||
exports[`R_append(string, number_array) 1`] = ` | ||
"Argument of type 'number[]' is not assignable to parameter of type 'List<string>'. | ||
Type 'number[]' is not assignable to type 'ArrayLike<string>'." | ||
`; |
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 |
---|---|---|
@@ -1,7 +1,21 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`R_insert(number)(string)(object_array) 1`] = `"(string | object)[]"`; | ||
exports[`R_insert(number)(object)(object_array) 1`] = `"object[]"`; | ||
|
||
exports[`R_insert(number, string) 1`] = `"<U>(list: U[] | ArrayLike<U>) => (string | U)[]"`; | ||
exports[`R_insert(number)(string)(object_array) 1`] = ` | ||
"Argument of type 'object[]' is not assignable to parameter of type 'List<string>'. | ||
Type 'object[]' is not assignable to type 'ArrayLike<string>'." | ||
`; | ||
exports[`R_insert(number, string, object_array) 1`] = `"(string | object)[]"`; | ||
exports[`R_insert(number, object) 1`] = `"(list: object[] | ArrayLike<object>) => object[]"`; | ||
exports[`R_insert(number, object, object_array) 1`] = `"object[]"`; | ||
exports[`R_insert(number, string) 1`] = `"(list: string[] | ArrayLike<string>) => string[]"`; | ||
exports[`R_insert(number, string, object_array) 1`] = ` | ||
"Argument of type 'object[]' is not assignable to parameter of type 'List<string>'. | ||
Type 'object[]' is not assignable to type 'ArrayLike<string>'. | ||
Index signatures are incompatible. | ||
Type 'object' is not assignable to type 'string'." | ||
`; |
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 |
---|---|---|
@@ -1,7 +1,19 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`R_insertAll(number)(string_array)(object_array) 1`] = `"(string | object)[]"`; | ||
exports[`R_insertAll(number)(string_array)(object_array) 1`] = ` | ||
"Argument of type 'object[]' is not assignable to parameter of type 'List<string>'. | ||
Type 'object[]' is not assignable to type 'ArrayLike<string>'." | ||
`; | ||
exports[`R_insertAll(number, string_array) 1`] = `"<U>(list: U[] | ArrayLike<U>) => (string | U)[]"`; | ||
exports[`R_insertAll(number)(string_array)(string_array) 1`] = `"string[]"`; | ||
exports[`R_insertAll(number, string_array, object_array) 1`] = `"(string | object)[]"`; | ||
exports[`R_insertAll(number, string_array) 1`] = `"(list: string[] | ArrayLike<string>) => string[]"`; | ||
exports[`R_insertAll(number, string_array, object_array) 1`] = ` | ||
"Argument of type 'object[]' is not assignable to parameter of type 'List<string>'. | ||
Type 'object[]' is not assignable to type 'ArrayLike<string>'. | ||
Index signatures are incompatible. | ||
Type 'object' is not assignable to type 'string'." | ||
`; | ||
exports[`R_insertAll(number, string_array, string_array) 1`] = `"string[]"`; |
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 |
---|---|---|
@@ -1,5 +1,17 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`R_prepend(string)(number_array) 1`] = `"(string | number)[]"`; | ||
exports[`R_prepend(number)(number_array) 1`] = `"number[]"`; | ||
|
||
exports[`R_prepend(string, number_array) 1`] = `"(string | number)[]"`; | ||
exports[`R_prepend(number, number_array) 1`] = `"number[]"`; | ||
|
||
exports[`R_prepend(string)(number_array) 1`] = ` | ||
"Argument of type 'number[]' is not assignable to parameter of type 'List<string>'. | ||
Type 'number[]' is not assignable to type 'ArrayLike<string>'. | ||
Index signatures are incompatible. | ||
Type 'number' is not assignable to type 'string'." | ||
`; | ||
exports[`R_prepend(string, number_array) 1`] = ` | ||
"Argument of type 'number[]' is not assignable to parameter of type 'List<string>'. | ||
Type 'number[]' is not assignable to type 'ArrayLike<string>'." | ||
`; |
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
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 |
---|---|---|
@@ -1,7 +1,19 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`R_update(number)(boolean)(string_array) 1`] = `"(string | boolean)[]"`; | ||
exports[`R_update(number)(boolean)(string_array) 1`] = ` | ||
"Argument of type 'string[]' is not assignable to parameter of type 'List<boolean>'. | ||
Type 'string[]' is not assignable to type 'ArrayLike<boolean>'. | ||
Index signatures are incompatible. | ||
Type 'string' is not assignable to type 'boolean'." | ||
`; | ||
exports[`R_update(number, boolean) 1`] = `"<U>(list: U[] | ArrayLike<U>) => (boolean | U)[]"`; | ||
exports[`R_update(number)(string)(string_array) 1`] = `"string[]"`; | ||
exports[`R_update(number, boolean, string_array) 1`] = `"(string | boolean)[]"`; | ||
exports[`R_update(number, boolean) 1`] = `"(list: boolean[] | ArrayLike<boolean>) => boolean[]"`; | ||
exports[`R_update(number, boolean, string_array) 1`] = ` | ||
"Argument of type 'string[]' is not assignable to parameter of type 'List<boolean>'. | ||
Type 'string[]' is not assignable to type 'ArrayLike<boolean>'." | ||
`; | ||
exports[`R_update(number, string, string_array) 1`] = `"string[]"`; |
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 |
---|---|---|
@@ -1,13 +1,20 @@ | ||
import {Morphism} from '../ramda/dist/src/$types'; | ||
import * as R_adjust from '../ramda/dist/src/adjust'; | ||
|
||
declare const string_to_string: Morphism<string, string>; | ||
declare const string_to_number: Morphism<string, number>; | ||
declare const string_array: string[]; | ||
declare const number: number; | ||
|
||
// @dts-jest:pass | ||
// @dts-jest:fail | ||
R_adjust(string_to_number)(number, string_array); | ||
// @dts-jest:pass | ||
// @dts-jest:fail | ||
R_adjust(string_to_number, number)(string_array); | ||
// @dts-jest:pass | ||
// @dts-jest:fail | ||
R_adjust(string_to_number, number, string_array); | ||
// @dts-jest:pass | ||
R_adjust(string_to_string)(number, string_array); | ||
// @dts-jest:pass | ||
R_adjust(string_to_string, number)(string_array); | ||
// @dts-jest:pass | ||
R_adjust(string_to_string, number, string_array); |
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 |
---|---|---|
@@ -1,9 +1,14 @@ | ||
import * as R_append from '../ramda/dist/src/append'; | ||
|
||
declare const string: string; | ||
declare const number: number; | ||
declare const number_array: number[]; | ||
|
||
// @dts-jest:pass | ||
// @dts-jest:fail | ||
R_append(string)(number_array); | ||
// @dts-jest:pass | ||
// @dts-jest:fail | ||
R_append(string, number_array); | ||
// @dts-jest:pass | ||
R_append(number)(number_array); | ||
// @dts-jest:pass | ||
R_append(number, number_array); |
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 |
---|---|---|
@@ -1,12 +1,20 @@ | ||
import * as R_insert from '../ramda/dist/src/insert'; | ||
|
||
declare const object: object; | ||
declare const object_array: object[]; | ||
declare const string: string; | ||
declare const number: number; | ||
|
||
// @dts-jest:pass | ||
R_insert(number, string); | ||
// @dts-jest:pass | ||
// @dts-jest:fail | ||
R_insert(number, string, object_array); | ||
// @dts-jest:pass | ||
// @dts-jest:fail | ||
R_insert(number)(string)(object_array); | ||
|
||
// @dts-jest:pass | ||
R_insert(number, object); | ||
// @dts-jest:pass | ||
R_insert(number, object, object_array); | ||
// @dts-jest:pass | ||
R_insert(number)(object)(object_array); |
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
Oops, something went wrong.