[ 
https://issues.apache.org/jira/browse/ARROW-12302?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dominik Moritz reassigned ARROW-12302:
--------------------------------------

    Assignee: Paul Taylor

> [JS] Arrow does not compile with Typescript 4.2
> -----------------------------------------------
>
>                 Key: ARROW-12302
>                 URL: https://issues.apache.org/jira/browse/ARROW-12302
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: JavaScript
>            Reporter: Dominik Moritz
>            Assignee: Paul Taylor
>            Priority: Major
>
> {code:java}
> yarn tsc
> yarn run v1.22.10
> $ /Users/dominik/Code/arrow/js/node_modules/.bin/tsc
> src/bin/arrow2csv.ts:104:24 - error TS7057: 'yield' expression implicitly 
> results in an 'any' type because its containing generator lacks a return-type 
> annotation.104             reader && (yield reader);
>                            ~~~~~~~~~~~~src/bin/arrow2csv.ts:115:28 - error 
> TS7057: 'yield' expression implicitly results in an 'any' type because its 
> containing generator lacks a return-type annotation.115                 
> reader && (yield reader);
>                                ~~~~~~~~~~~~src/interfaces.ts:255:5 - error 
> TS2502: '[Type.List                 ]' is referenced directly or indirectly 
> in its own type annotation.255     [Type.List                 ]: T extends 
> type.List                 ? vecs.ListVector<T['valueType']>                   
>   : never ;
>         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~src/interfaces.ts:258:5 - error TS2502: 
> '[Type.FixedSizeList        ]' is referenced directly or indirectly in its 
> own type annotation.258     [Type.FixedSizeList        ]: T extends 
> type.FixedSizeList        ? vecs.FixedSizeListVector<T['valueType']>          
>   : never ;
>         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~src/io/adapters.ts:207:25 - error TS2304: 
> Cannot find name 'ReadableStreamBYOBReader'.207     private byobReader: 
> ReadableStreamBYOBReader | null = null;
>                             ~~~~~~~~~~~~~~~~~~~~~~~~src/io/adapters.ts:209:21 
> - error TS2304: Cannot find name 'ReadableStreamBYOBReader'.209     private 
> reader: ReadableStreamBYOBReader | ReadableStreamDefaultReader<T> | null;
>                         ~~~~~~~~~~~~~~~~~~~~~~~~src/io/adapters.ts:264:56 - 
> error TS2554: Expected 0 arguments, but got 1.264             this.byobReader 
> = this.source['getReader']({ mode: 'byob' });
>                                                            
> ~~~~~~~~~~~~~~~~src/io/adapters.ts:283:33 - error TS2304: Cannot find name 
> 'ReadableStreamBYOBReader'.283 async function readInto(reader: 
> ReadableStreamBYOBReader, buffer: ArrayBufferLike, offset: number, size: 
> number): Promise<ReadableStreamReadResult<Uint8Array>> {
>                                     
> ~~~~~~~~~~~~~~~~~~~~~~~~src/io/adapters.ts:303:17 - error TS2322: Type 
> '(value: [T, any] | PromiseLike<[T, any]>) => void' is not assignable to type 
> '(value?: [T, any] | PromiseLike<[T, any]> | undefined) => void'.303         
> (r) => (resolve = r) && stream['once'](event, handler)
>                     ~~~~~~~src/io/adapters.ts:303:17 - error TS2322: Type 
> '(value: [T, any] | PromiseLike<[T, any]>) => void' is not assignable to type 
> '(value?: [T, any] | PromiseLike<[T, any]> | undefined) => void'.
>   Types of parameters 'value' and 'value' are incompatible.
>     Type '[T, any] | PromiseLike<[T, any]> | undefined' is not assignable to 
> type '[T, any] | PromiseLike<[T, any]>'.
>       Type 'undefined' is not assignable to type '[T, any] | PromiseLike<[T, 
> any]>'.303         (r) => (resolve = r) && stream['once'](event, handler)
>                     ~~~~~~~src/io/adapters.ts:394:45 - error TS2794: Expected 
> 1 arguments, but got 0. Did you forget to include 'void' in your type 
> argument to 'Promise'?394                 err != null ? reject(err) : 
> resolve();
>                                                 ~~~~~~~~~  
> node_modules/typescript/lib/lib.es2015.promise.d.ts:33:34
>     33     new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, 
> reject: (reason?: any) => void) => void): Promise<T>;
>                                         ~~~~~~~~~~~~~~~~~~~~~~~~~
>     An argument for 'value' was not provided.src/io/interfaces.ts:79:58 - 
> error TS2304: Cannot find name 'PipeOptions'.79     public pipeTo(writable: 
> WritableStream<T>, options?: PipeOptions) { return 
> this._getDOMStream().pipeTo(writable, options); }
>                                                             
> ~~~~~~~~~~~src/io/interfaces.ts:80:119 - error TS2304: Cannot find name 
> 'PipeOptions'.80     public pipeThrough<R extends 
> ReadableStream<any>>(duplex: { writable: WritableStream<T>, readable: R }, 
> options?: PipeOptions) {
>                                                                               
>                                            
> ~~~~~~~~~~~src/io/interfaces.ts:169:39 - error TS2322: Type '(value: 
> IteratorResult<TReadable, any> | PromiseLike<IteratorResult<TReadable, any>>) 
> => void' is not assignable to type '(value?: IteratorResult<TReadable, any> | 
> PromiseLike<IteratorResult<TReadable, any>> | undefined) => void'.
>   Types of parameters 'value' and 'value' are incompatible.
>     Type 'IteratorResult<TReadable, any> | 
> PromiseLike<IteratorResult<TReadable, any>> | undefined' is not assignable to 
> type 'IteratorResult<TReadable, any> | PromiseLike<IteratorResult<TReadable, 
> any>>'.
>       Type 'undefined' is not assignable to type 'IteratorResult<TReadable, 
> any> | PromiseLike<IteratorResult<TReadable, any>>'.169                 
> this.resolvers.push({ resolve, reject });
>                                           ~~~~~~~  src/io/interfaces.ts:96:24
>     96 type Resolution<T> = { resolve: (value?: T | PromiseLike<T>) => void; 
> reject: (reason?: any) => void; };
>                               ~~~~~~~
>     The expected type comes from property 'resolve' which is declared here on 
> type 'Resolution<IteratorResult<TReadable, any>>'src/io/whatwg/writer.ts:33:9 
> - error TS2322: Type 'string' is not assignable to type 'undefined'.33        
>  type: 'bytes',
>            ~~~~src/recordbatch.ts:48:19 - error TS2394: This overload 
> signature is not compatible with its implementation signature.48     public 
> static from<T extends { [key: string]: DataType } = any, TNull = 
> any>(options: VectorBuilderOptionsAsync<Struct<T>, TNull>): Promise<Table<T>>;
>                      ~~~~  src/recordbatch.ts:50:19
>     50     public static from<T extends { [key: string]: DataType } = any, 
> TNull = any>(options: VectorBuilderOptions<Struct<T>, TNull> | 
> VectorBuilderOptionsAsync<Struct<T>, TNull>) {
>                          ~~~~
>     The implementation signature is declared here.src/util/buffer.ts:89:11 - 
> error TS2304: Cannot find name 'ReadableStreamReadResult'.89           
> ReadableStreamReadResult<ArrayBufferView | ArrayBufferLike | ArrayBufferView 
> | Iterable<number> | ArrayLike<number> | ByteBuffer | string | null | 
> undefined> ;
>              ~~~~~~~~~~~~~~~~~~~~~~~~src/vector/index.ts:88:55 - error 
> TS2502: 'args' is referenced directly or indirectly in its own type 
> annotation.88 function newVector<T extends DataType>(data: Data<T>, ...args: 
> VectorCtorArgs<V<T>>): V<T> {
>                                                          
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~src/vector/map.ts:26:12 - error TS7023: 'asList' 
> implicitly has return type 'any' because it does not have a return type 
> annotation and is referenced directly or indirectly in one of its return 
> expressions.26     public asList() {
>               ~~~~~~
> Found 19 errors.
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to