Define ArrayBufferView and TypedArray as interfaces rather than classes#4181
Define ArrayBufferView and TypedArray as interfaces rather than classes#4181niloc132 wants to merge 8 commits intogoogle:masterfrom
Conversation
|
@mollyibot Could you patch the PR internally and see if it causes any problems? |
| * @implements {ArrayBufferView} | ||
| * @throws {Error} | ||
| * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays/DataView | ||
| */ |
There was a problem hiding this comment.
and this breaks j2clproto and elemental2 tests, taking a deeper look.
There was a problem hiding this comment.
at first , tests failed No name provided for parameter 'elemental2.core.ReadonlyArray.EveryCallbackFn.onInvoke.p0'. Name can be specified in a name mapping file. after removing some unused integer entities from elemental2, this error went away. Then tests failed //third_party/java_src/j2cl_proto/java/com/google/protobuf/contrib/j2cl/runtime:runtime Error:ByteString.java:78: Cannot cast from BigUint64Array to Uint8Array , and also
Exception in thread "main" java.lang.IllegalStateException: No declaration found for member [Property { name: BYTES_PER_ELEMENT, type:number, inferred: false}]. Please fix the extern file. A class must implement all methods from its super interfaces.
and
Error:BigInt64Array.java:22: The type BigInt64Array must implement the inherited abstract method TypedArray.copyWithin(int, int, int)
Error:BigInt64Array.java:22: The type BigInt64Array must implement the inherited abstract method TypedArray.set(TypedArray.SetArrayUnionType, int)
Error:BigInt64Array.java:22: The type BigInt64Array must implement the inherited abstract method TypedArray.at(int)
Error:BigInt64Array.java:22: The type BigInt64Array must implement the inherited abstract method TypedArray.subarray(int)
Error:BigInt64Array.java:22: The type BigInt64Array must implement the inherited abstract method TypedArray.subarray(int, int)
Error:BigInt64Array.java:22: The type BigInt64Array must implement the inherited abstract method TypedArray.fill(double, int)
Error:BigInt64Array.java:22: The type BigInt64Array must implement the inherited abstract method TypedArray.fill(double, int, int)
Error:BigInt64Array.java:22: The type BigInt64Array must implement the inherited abstract method TypedArray.slice(int)
Error:BigInt64Array.java:22: The type BigInt64Array must implement the inherited abstract method TypedArray.slice(int, int)
Error:BigInt64Array.java:22: The type BigInt64Array must implement the inherited abstract method TypedArray.toString_()
Error:BigInt64Array.java:22: The type BigInt64Array must implement the inherited abstract method TypedArray.indexOf(double, int)
Error:BigInt64Array.java:22: The type BigInt64Array must implement the inherited abstract method TypedArray.includes(double, int)
Error:BigInt64Array.java:22: The type BigInt64Array must implement the inherited abstract method TypedArray.lastIndexOf(double, int)
Error:BigInt64Array.java:22: The type BigInt64Array must implement the inherited abstract method TypedArray.toLocaleString()
Error:BigInt64Array.java:185: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn, S)
Error:BigInt64Array.java:186: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn)
Error:BigInt64Array.java:189: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn, S)
Error:BigInt64Array.java:190: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn)
Error:BigInt64Array.java:206: The return type is incompatible with TypedArray.indexOf(double)
Error:BigInt64Array.java:211: The return type is incompatible with TypedArray.lastIndexOf(double)
Error:BigUint64Array.java:21: The type BigUint64Array must implement the inherited abstract method TypedArray.copyWithin(int, int)
Error:BigUint64Array.java:21: The type BigUint64Array must implement the inherited abstract method TypedArray.copyWithin(int, int, int)
Error:BigUint64Array.java:21: The type BigUint64Array must implement the inherited abstract method TypedArray.set(TypedArray.SetArrayUnionType, int)
Error:BigUint64Array.java:21: The type BigUint64Array must implement the inherited abstract method TypedArray.at(int)
Error:BigUint64Array.java:21: The type BigUint64Array must implement the inherited abstract method TypedArray.subarray(int)
Error:BigUint64Array.java:21: The type BigUint64Array must implement the inherited abstract method TypedArray.subarray(int, int)
Error:BigUint64Array.java:21: The type BigUint64Array must implement the inherited abstract method TypedArray.fill(double, int)
Error:BigUint64Array.java:21: The type BigUint64Array must implement the inherited abstract method TypedArray.fill(double, int, int)
Error:BigUint64Array.java:21: The type BigUint64Array must implement the inherited abstract method TypedArray.slice(int)
Error:BigUint64Array.java:21: The type BigUint64Array must implement the inherited abstract method TypedArray.slice(int, int)
Error:BigUint64Array.java:21: The type BigUint64Array must implement the inherited abstract method TypedArray.toString_()
Error:BigUint64Array.java:21: The type BigUint64Array must implement the inherited abstract method TypedArray.indexOf(double, int)
Error:BigUint64Array.java:21: The type BigUint64Array must implement the inherited abstract method TypedArray.includes(double, int)
Error:BigUint64Array.java:21: The type BigUint64Array must implement the inherited abstract method TypedArray.lastIndexOf(double, int)
Error:BigUint64Array.java:21: The type BigUint64Array must implement the inherited abstract method TypedArray.toLocaleString()
Error:BigUint64Array.java:184: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn, S)
Error:BigUint64Array.java:185: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn)
Error:BigUint64Array.java:188: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn, S)
Error:BigUint64Array.java:189: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn)
Error:BigUint64Array.java:205: The return type is incompatible with TypedArray.indexOf(double)
Error:BigUint64Array.java:210: The return type is incompatible with TypedArray.lastIndexOf(double)
Error:Float32Array.java:21: The type Float32Array must implement the inherited abstract method TypedArray.copyWithin(int, int)
Error:Float32Array.java:21: The type Float32Array must implement the inherited abstract method TypedArray.copyWithin(int, int, int)
Error:Float32Array.java:21: The type Float32Array must implement the inherited abstract method TypedArray.set(TypedArray.SetArrayUnionType, int)
Error:Float32Array.java:21: The type Float32Array must implement the inherited abstract method TypedArray.at(int)
Error:Float32Array.java:21: The type Float32Array must implement the inherited abstract method TypedArray.subarray(int)
Error:Float32Array.java:21: The type Float32Array must implement the inherited abstract method TypedArray.subarray(int, int)
Error:Float32Array.java:21: The type Float32Array must implement the inherited abstract method TypedArray.fill(double, int)
Error:Float32Array.java:21: The type Float32Array must implement the inherited abstract method TypedArray.fill(double, int, int)
Error:Float32Array.java:21: The type Float32Array must implement the inherited abstract method TypedArray.slice(int)
Error:Float32Array.java:21: The type Float32Array must implement the inherited abstract method TypedArray.slice(int, int)
Error:Float32Array.java:21: The type Float32Array must implement the inherited abstract method TypedArray.toString_()
Error:Float32Array.java:21: The type Float32Array must implement the inherited abstract method TypedArray.indexOf(double, int)
Error:Float32Array.java:21: The type Float32Array must implement the inherited abstract method TypedArray.includes(double, int)
Error:Float32Array.java:21: The type Float32Array must implement the inherited abstract method TypedArray.lastIndexOf(double, int)
Error:Float32Array.java:21: The type Float32Array must implement the inherited abstract method TypedArray.toLocaleString()
Error:Float32Array.java:184: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn, S)
Error:Float32Array.java:185: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn)
Error:Float32Array.java:188: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn, S)
Error:Float32Array.java:189: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn)
Error:Float32Array.java:205: The return type is incompatible with TypedArray.indexOf(double)
Error:Float32Array.java:210: The return type is incompatible with TypedArray.lastIndexOf(double)
Error:Float64Array.java:21: The type Float64Array must implement the inherited abstract method TypedArray.copyWithin(int, int)
Error:Float64Array.java:21: The type Float64Array must implement the inherited abstract method TypedArray.copyWithin(int, int, int)
Error:Float64Array.java:21: The type Float64Array must implement the inherited abstract method TypedArray.set(TypedArray.SetArrayUnionType, int)
Error:Float64Array.java:21: The type Float64Array must implement the inherited abstract method TypedArray.at(int)
Error:Float64Array.java:21: The type Float64Array must implement the inherited abstract method TypedArray.subarray(int)
Error:Float64Array.java:21: The type Float64Array must implement the inherited abstract method TypedArray.subarray(int, int)
Error:Float64Array.java:21: The type Float64Array must implement the inherited abstract method TypedArray.fill(double, int)
Error:Float64Array.java:21: The type Float64Array must implement the inherited abstract method TypedArray.fill(double, int, int)
Error:Float64Array.java:21: The type Float64Array must implement the inherited abstract method TypedArray.slice(int)
Error:Float64Array.java:21: The type Float64Array must implement the inherited abstract method TypedArray.slice(int, int)
Error:Float64Array.java:21: The type Float64Array must implement the inherited abstract method TypedArray.toString_()
Error:Float64Array.java:21: The type Float64Array must implement the inherited abstract method TypedArray.indexOf(double, int)
Error:Float64Array.java:21: The type Float64Array must implement the inherited abstract method TypedArray.includes(double, int)
Error:Float64Array.java:21: The type Float64Array must implement the inherited abstract method TypedArray.lastIndexOf(double, int)
Error:Float64Array.java:21: The type Float64Array must implement the inherited abstract method TypedArray.toLocaleString()
Error:Float64Array.java:184: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn, S)
Error:Float64Array.java:185: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn)
Error:Float64Array.java:188: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn, S)
Error:Float64Array.java:189: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn)
Error:Float64Array.java:205: The return type is incompatible with TypedArray.indexOf(double)
Error:Float64Array.java:210: The return type is incompatible with TypedArray.lastIndexOf(double)
Error:Int16Array.java:21: The type Int16Array must implement the inherited abstract method TypedArray.copyWithin(int, int)
Error:Int16Array.java:21: The type Int16Array must implement the inherited abstract method TypedArray.copyWithin(int, int, int)
Error:Int16Array.java:21: The type Int16Array must implement the inherited abstract method TypedArray.set(TypedArray.SetArrayUnionType, int)
Error:Int16Array.java:21: The type Int16Array must implement the inherited abstract method TypedArray.at(int)
Error:Int16Array.java:21: The type Int16Array must implement the inherited abstract method TypedArray.subarray(int)
Error:Int16Array.java:21: The type Int16Array must implement the inherited abstract method TypedArray.subarray(int, int)
Error:Int16Array.java:21: The type Int16Array must implement the inherited abstract method TypedArray.fill(double, int)
Error:Int16Array.java:21: The type Int16Array must implement the inherited abstract method TypedArray.fill(double, int, int)
Error:Int16Array.java:21: The type Int16Array must implement the inherited abstract method TypedArray.slice(int)
Error:Int16Array.java:21: The type Int16Array must implement the inherited abstract method TypedArray.slice(int, int)
Error:Int16Array.java:21: The type Int16Array must implement the inherited abstract method TypedArray.toString_()
Error:Int16Array.java:21: The type Int16Array must implement the inherited abstract method TypedArray.indexOf(double, int)
Error:Int16Array.java:21: The type Int16Array must implement the inherited abstract method TypedArray.includes(double, int)
Error:Int16Array.java:21: The type Int16Array must implement the inherited abstract method TypedArray.lastIndexOf(double, int)
Error:Int16Array.java:21: The type Int16Array must implement the inherited abstract method TypedArray.toLocaleString()
Error:Int16Array.java:184: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn, S)
Error:Int16Array.java:185: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn)
Error:Int16Array.java:188: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn, S)
Error:Int16Array.java:189: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn)
Error:Int16Array.java:205: The return type is incompatible with TypedArray.indexOf(double)
Error:Int16Array.java:210: The return type is incompatible with TypedArray.lastIndexOf(double)
Error:Int32Array.java:21: The type Int32Array must implement the inherited abstract method TypedArray.copyWithin(int, int)
Error:Int32Array.java:21: The type Int32Array must implement the inherited abstract method TypedArray.copyWithin(int, int, int)
Error:Int32Array.java:21: The type Int32Array must implement the inherited abstract method TypedArray.set(TypedArray.SetArrayUnionType, int)
Error:Int32Array.java:21: The type Int32Array must implement the inherited abstract method TypedArray.at(int)
Error:Int32Array.java:21: The type Int32Array must implement the inherited abstract method TypedArray.subarray(int)
Error:Int32Array.java:21: The type Int32Array must implement the inherited abstract method TypedArray.subarray(int, int)
Error:Int32Array.java:21: The type Int32Array must implement the inherited abstract method TypedArray.fill(double, int)
Error:Int32Array.java:21: The type Int32Array must implement the inherited abstract method TypedArray.fill(double, int, int)
Error:Int32Array.java:21: The type Int32Array must implement the inherited abstract method TypedArray.slice(int)
Error:Int32Array.java:21: The type Int32Array must implement the inherited abstract method TypedArray.slice(int, int)
Error:Int32Array.java:21: The type Int32Array must implement the inherited abstract method TypedArray.toString_()
Error:Int32Array.java:21: The type Int32Array must implement the inherited abstract method TypedArray.indexOf(double, int)
Error:Int32Array.java:21: The type Int32Array must implement the inherited abstract method TypedArray.includes(double, int)
Error:Int32Array.java:21: The type Int32Array must implement the inherited abstract method TypedArray.lastIndexOf(double, int)
Error:Int32Array.java:21: The type Int32Array must implement the inherited abstract method TypedArray.toLocaleString()
Error:Int32Array.java:184: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn, S)
Error:Int32Array.java:185: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn)
Error:Int32Array.java:188: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn, S)
Error:Int32Array.java:189: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn)
Error:Int32Array.java:205: The return type is incompatible with TypedArray.indexOf(double)
Error:Int32Array.java:210: The return type is incompatible with TypedArray.lastIndexOf(double)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.copyWithin(int, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.copyWithin(int, int, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.set(TypedArray.SetArrayUnionType, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.at(int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.subarray(int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.subarray(int, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.fill(double, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.fill(double, int, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.slice(int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.slice(int, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.toString_()
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.indexOf(double, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.includes(double, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.lastIndexOf(double, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.toLocaleString()
Error:Int8Array.java:184: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn, S)
Error:Int8Array.java:185: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn)
Error:Int8Array.java:188: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn, S)
Error:Int8Array.java:189: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn)
Error:Int8Array.java:205: The return type is incompatible with TypedArray.indexOf(double)
Error:Int8Array.java:210: The return type is incompatible with TypedArray.lastIndexOf(double)
Error:TypedArray.java:157: The return type is incompatible with JsArrayLike<Double>.getLength()
Error:Uint16Array.java:21: The type Uint16Array must implement the inherited abstract method TypedArray.copyWithin(int, int)
Error:Uint16Array.java:21: The type Uint16Array must implement the inherited abstract method TypedArray.copyWithin(int, int, int)
Error:Uint16Array.java:21: The type Uint16Array must implement the inherited abstract method TypedArray.set(TypedArray.SetArrayUnionType, int)
Error:Uint16Array.java:21: The type Uint16Array must implement the inherited abstract method TypedArray.at(int)
Error:Uint16Array.java:21: The type Uint16Array must implement the inherited abstract method TypedArray.subarray(int)
Error:Uint16Array.java:21: The type Uint16Array must implement the inherited abstract method TypedArray.subarray(int, int)
Error:Uint16Array.java:21: The type Uint16Array must implement the inherited abstract method TypedArray.fill(double, int)
Error:Uint16Array.java:21: The type Uint16Array must implement the inherited abstract method TypedArray.fill(double, int, int)
Error:Uint16Array.java:21: The type Uint16Array must implement the inherited abstract method TypedArray.slice(int)
Error:Uint16Array.java:21: The type Uint16Array must implement the inherited abstract method TypedArray.slice(int, int)
Error:Uint16Array.java:21: The type Uint16Array must implement the inherited abstract method TypedArray.toString_()
Error:Uint16Array.java:21: The type Uint16Array must implement the inherited abstract method TypedArray.indexOf(double, int)
Error:Uint16Array.java:21: The type Uint16Array must implement the inherited abstract method TypedArray.includes(double, int)
Error:Uint16Array.java:21: The type Uint16Array must implement the inherited abstract method TypedArray.lastIndexOf(double, int)
Error:Uint16Array.java:21: The type Uint16Array must implement the inherited abstract method TypedArray.toLocaleString()
Error:Uint16Array.java:184: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn, S)
Error:Uint16Array.java:185: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn)
Error:Uint16Array.java:188: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn, S)
Error:Uint16Array.java:189: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn)
Error:Uint16Array.java:205: The return type is incompatible with TypedArray.indexOf(double)
Error:Uint16Array.java:210: The return type is incompatible with TypedArray.lastIndexOf(double)
Error:Uint32Array.java:21: The type Uint32Array must implement the inherited abstract method TypedArray.copyWithin(int, int)
Error:Uint32Array.java:21: The type Uint32Array must implement the inherited abstract method TypedArray.copyWithin(int, int, int)
Error:Uint32Array.java:21: The type Uint32Array must implement the inherited abstract method TypedArray.set(TypedArray.SetArrayUnionType, int)
Error:Uint32Array.java:21: The type Uint32Array must implement the inherited abstract method TypedArray.at(int)
Error:Uint32Array.java:21: The type Uint32Array must implement the inherited abstract method TypedArray.subarray(int)
Error:Uint32Array.java:21: The type Uint32Array must implement the inherited abstract method TypedArray.subarray(int, int)
Error:Uint32Array.java:21: The type Uint32Array must implement the inherited abstract method TypedArray.fill(double, int)
Error:Uint32Array.java:21: The type Uint32Array must implement the inherited abstract method TypedArray.fill(double, int, int)
Error:Uint32Array.java:21: The type Uint32Array must implement the inherited abstract method TypedArray.slice(int)
Error:Uint32Array.java:21: The type Uint32Array must implement the inherited abstract method TypedArray.slice(int, int)
Error:Uint32Array.java:21: The type Uint32Array must implement the inherited abstract method TypedArray.toString_()
Error:Uint32Array.java:21: The type Uint32Array must implement the inherited abstract method TypedArray.indexOf(double, int)
Error:Uint32Array.java:21: The type Uint32Array must implement the inherited abstract method TypedArray.includes(double, int)
Error:Uint32Array.java:21: The type Uint32Array must implement the inherited abstract method TypedArray.lastIndexOf(double, int)
Error:Uint32Array.java:21: The type Uint32Array must implement the inherited abstract method TypedArray.toLocaleString()
Error:Uint32Array.java:184: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn, S)
Error:Uint32Array.java:185: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn)
Error:Uint32Array.java:188: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn, S)
Error:Uint32Array.java:189: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn)
Error:Uint32Array.java:205: The return type is incompatible with TypedArray.indexOf(double)
Error:Uint32Array.java:210: The return type is incompatible with TypedArray.lastIndexOf(double)
Error:Uint8Array.java:21: The type Uint8Array must implement the inherited abstract method TypedArray.copyWithin(int, int)
Error:Uint8Array.java:21: The type Uint8Array must implement the inherited abstract method TypedArray.copyWithin(int, int, int)
Error:Uint8Array.java:21: The type Uint8Array must implement the inherited abstract method TypedArray.set(TypedArray.SetArrayUnionType, int)
Error:Uint8Array.java:21: The type Uint8Array must implement the inherited abstract method TypedArray.at(int)
Error:Uint8Array.java:21: The type Uint8Array must implement the inherited abstract method TypedArray.subarray(int)
Error:Uint8Array.java:21: The type Uint8Array must implement the inherited abstract method TypedArray.subarray(int, int)
Error:Uint8Array.java:21: The type Uint8Array must implement the inherited abstract method TypedArray.fill(double, int)
Error:Uint8Array.java:21: The type Uint8Array must implement the inherited abstract method TypedArray.fill(double, int, int)
Error:Uint8Array.java:21: The type Uint8Array must implement the inherited abstract method TypedArray.slice(int)
Error:Uint8Array.java:21: The type Uint8Array must implement the inherited abstract method TypedArray.slice(int, int)
Error:Uint8Array.java:21: The type Uint8Array must implement the inherited abstract method TypedArray.toString_()
Error:Uint8Array.java:21: The type Uint8Array must implement the inherited abstract method TypedArray.indexOf(double, int)
Error:Uint8Array.java:21: The type Uint8Array must implement the inherited abstract method TypedArray.includes(double, int)
Error:Uint8Array.java:21: The type Uint8Array must implement the inherited abstract method TypedArray.lastIndexOf(double, int)
Error:Uint8Array.java:21: The type Uint8Array must implement the inherited abstract method TypedArray.toLocaleString()
Error:Uint8Array.java:184: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn, S)
Error:Uint8Array.java:185: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn)
Error:Uint8Array.java:188: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn, S)
Error:Uint8Array.java:189: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn)
Error:Uint8Array.java:205: The return type is incompatible with TypedArray.indexOf(double)
Error:Uint8Array.java:210: The return type is incompatible with TypedArray.lastIndexOf(double)
Error:Uint8ClampedArray.java:21: The type Uint8ClampedArray must implement the inherited abstract method TypedArray.copyWithin(int, int)
Error:Uint8ClampedArray.java:21: The type Uint8ClampedArray must implement the inherited abstract method TypedArray.copyWithin(int, int, int)
Error:Uint8ClampedArray.java:21: The type Uint8ClampedArray must implement the inherited abstract method TypedArray.set(TypedArray.SetArrayUnionType, int)
Error:Uint8ClampedArray.java:21: The type Uint8ClampedArray must implement the inherited abstract method TypedArray.at(int)
Error:Uint8ClampedArray.java:21: The type Uint8ClampedArray must implement the inherited abstract method TypedArray.subarray(int)
Error:Uint8ClampedArray.java:21: The type Uint8ClampedArray must implement the inherited abstract method TypedArray.subarray(int, int)
Error:Uint8ClampedArray.java:21: The type Uint8ClampedArray must implement the inherited abstract method TypedArray.fill(double, int)
Error:Uint8ClampedArray.java:21: The type Uint8ClampedArray must implement the inherited abstract method TypedArray.fill(double, int, int)
Error:Uint8ClampedArray.java:21: The type Uint8ClampedArray must implement the inherited abstract method TypedArray.slice(int)
Error:Uint8ClampedArray.java:21: The type Uint8ClampedArray must implement the inherited abstract method TypedArray.slice(int, int)
Error:Uint8ClampedArray.java:21: The type Uint8ClampedArray must implement the inherited abstract method TypedArray.toString_()
Error:Uint8ClampedArray.java:21: The type Uint8ClampedArray must implement the inherited abstract method TypedArray.indexOf(double, int)
Error:Uint8ClampedArray.java:21: The type Uint8ClampedArray must implement the inherited abstract method TypedArray.includes(double, int)
Error:Uint8ClampedArray.java:21: The type Uint8ClampedArray must implement the inherited abstract method TypedArray.lastIndexOf(double, int)
Error:Uint8ClampedArray.java:21: The type Uint8ClampedArray must implement the inherited abstract method TypedArray.toLocaleString()
Error:Uint8ClampedArray.java:184: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn, S)
Error:Uint8ClampedArray.java:185: The return type is incompatible with TypedArray.findIndex(TypedArray.FindIndexCallbackFn)
Error:Uint8ClampedArray.java:188: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn, S)
Error:Uint8ClampedArray.java:189: The return type is incompatible with TypedArray.findLastIndex(TypedArray.FindLastIndexCallbackFn)
Error:Uint8ClampedArray.java:205: The return type is incompatible with TypedArray.indexOf(double)
Error:Uint8ClampedArray.java:210: The return type is incompatible with TypedArray.lastIndexOf(double)```
There was a problem hiding this comment.
Looking quickly at the integer_entities (for some related work, to be submitted as a PR soon), I suspect we just need to duplicate the entities found in TypedArray, as it will now be an interface, and classes that implement it now must declare the same signature, rather than just inheriting the native impl.
As an example, for these Uint8Array enjtries:
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.copyWithin(int, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.copyWithin(int, int, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.set(TypedArray.SetArrayUnionType, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.at(int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.subarray(int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.subarray(int, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.fill(double, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.fill(double, int, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.slice(int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.slice(int, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.toString_()
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.indexOf(double, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.includes(double, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.lastIndexOf(double, int)
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.toLocaleString()
I think the following integer entities, will resolve most of the above (sorted by the order of the errors above they will resolve, not alphabetical as expected):
elemental2.core.Uint8Array.copyWithin.target
elemental2.core.Uint8Array.copyWithin.start
elemental2.core.Uint8Array.copyWithin.end
elemental2.core.Uint8Array.set.offset
elemental2.core.Uint8Array.at.index
elemental2.core.Uint8Array.subarray.begin
elemental2.core.Uint8Array.subarray.end
elemental2.core.Uint8Array.fill.begin
elemental2.core.Uint8Array.fill.end
elemental2.core.Uint8Array.slice.begin
elemental2.core.Uint8Array.slice.end
elemental2.core.Uint8Array.indexOf
elemental2.core.Uint8Array.indexOf.fromIndex
elemental2.core.Uint8Array.includes.fromIndex
elemental2.core.Uint8Array.lastIndexOf
elemental2.core.Uint8Array.lastIndexOf.fromIndex
This leaves the following, which I don't yet understand:
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.toString_()
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.toLocaleString()
and this, which I'm not certain will be resolved (but might be, if the union type is inherited correctly):
Error:Int8Array.java:21: The type Int8Array must implement the inherited abstract method TypedArray.set(TypedArray.SetArrayUnionType, int)
|
@jDramaix Could you first provide general feedback on the direction before asking Colin to invest more time adapting the solution? |
|
I apologize for the churn, and am happy to spend some time exploring to make this work. The issue I'm seeking to resolve is that when jsinterop-generator builds elemental2, it sees these types and emits classes for them rather than interfaces, and so when a typedarray of some kind is used generically, the compiler emits casts, and those will fail since there is no constructor called TypedArray or ArrayBufferView in the global context. Note that there is a constructor called However, this is not accessible on the "global this", so cannot be used when performing Please let me know if there's another straightforward direction I can pursue here. I did not start trying to build elemental2 yet from this change, imagining incorrectly that it would just change the inheritance structure to the desired format. I can take a closer in a week or two, and hold off on this change for now, or if you see a fruitful direction for me to try I would be happy to follow that? -- At a glance, I'm not clear how to override the closure-compiler repo used by elemental2 - I followed the steps provided, but my changes to closure-compiler don't seem to be reflected in the generated output (both in that I still see but that doesn't quite get it right - it looks like transitive dependencies from closure aren't picked up this way ( |
|
I agree that defining To have this change compiling successfully, we need to modify several things:
Note that this change is likely to be a breaking change internally, so it may require some time before merging it. |
We used the extern files coming the closure compiler jar embedded in rules_closure We expect to have a |
Technically, the former appears to be a typedef and the latter might be a template for classes? But neither exists as a named function/constructor. Earlier versions of the spec do indicate that both were at one point interfaces though.
e4f1e02 to
91829e4
Compare
|
Updated to latest, hoping someone can take a look at this in the new year. |
|
@lauraharker does this look reasonable to you? |
…ufferview-interfaces
…ufferview-interfaces
|
Anything else I can do to help with this PR? |
|
I’ll try pulling in this PR and see if we run into any non-elemental2 / jsinterop issues |
|
@niloc132 Do you have the corresponding elemental2 changes ready for this PR? Otherwise PR immediately hits issue with elemental that breaks further testing. |
|
No, I had understood from Julien's statement from 2024
that this was pending work to be done within Google. For those repos it is my experience that Googlers usually wish to make their own changes, so I mostly wait and see. google/elemental2#183 Like j2cl, those repos are somewhat read-only to the public - it isn't clear that I can contribute in a meaningful way. If I'm mistaken, then I apologize and will pursue those changes as soon as I'm able. |
|
We received/accepted bunch of patches to J2CL when done properly but I don't want to get into argument on this again. @jDramaix what would you like to do about related change on on elemental2 side? |
|
I don't know why yet but this patch breaks the conversion of functions from the TypedArray class and subclasses that use the special The root cause is that with this change, the closure compiler returns the same e.g: /**
* @param {number} target
* @param {number} start
* @param {number=} opt_end
* @return {THIS}
* @this {THIS}
* @template THIS
*/
TypedArray.prototype.copyWithin = function(target, start, opt_end) {};generate the following Java Code: class TypeArray {
public native BigUint64Array copyWithin(double target, double start);
}instead of class TypeArray {
public native TypeArray copyWithin(double target, double start);
}@lauraharker any idea what could cause this different behavior in the Closure compiler ? |
|
Thanks to @lauraharker investigation, we identified the root cause: Now that TypedArray is an interface, all the concrete classes implementing the interface need to redefine (with @OverRide annotation) the functions of TypedArray. |
Closure did require that I overrode the iterator symbol for each subtype: etc. Should closure require that to build this change I add the other members as well? If so, should that be filed as a separate bug? Or do I misunderstand, and this is something that jsinterop-generator should handle? |
|
With "normal" closure code, the Javascript compiler would have rejected the code. For extern file, it is more lenient (I guess for legacy reasons) and does not complaint about that. It's mostly only impacting Elemental2 and we had to fix several externs file in order to get correct type information and generate correct Java code. |
|
Ok, I'll copy a simple override for each of these. |
…ufferview-interfaces
e9600b7 to
e8e885d
Compare
|
Okay, sorry for my delay on this, 3k lines of copy-paste-edit later... I took the functions declared on TypedArray (including the ones it already had as override) and copied them to each subtype, removing prose comments and adding BigUint64Array and BigInt64Array had to be further tweaked since they already had some overrides, I tried to make the added ones fit with correct alphabetical sort. Unfortunately I have no way to validate this work (as bazel test //:all passes both before and after this new commit), but I welcome any feedback you can offer. |
|
Thanks! I just pulled this into our internal repo and am waiting for test results. I'll update here once that's done. |
|
Hmm, from what I'm seeing, landing this would be much easier if we got rid of the TypedArray interface completely. Or at least, if we wanted to keep the TypedArray interface, removing all the method defintions from it, so it's only useful when combined with casting to a specific typed array subtype. There's a lot of (pre-existing) wrong method signatures for BigInt64 & BigUint64 especially, where something is typed with "number" and should be "bigint". Does anyone have any objections to removing or nerfing the TypedArray interface? Internally - I see we only use it in a few places, and even then, we don't really seem to call methods directly off a TypedArray. |
Technically, the former appears to be a typedef and the latter might be a template for classes? But neither exists as a named function/constructor. Earlier versions of the spec do indicate that both were at one point interfaces though.
This impacts https://github.com/google/elemental2, which then tries to use both types on the right side of JS
instanceofoperations, which will fail ("Right-hand side of 'instanceof' is not an object").As an alternative, one or both could be a typedef as the second link below seems to say? The archive.org link shows the older version where both were defined as interfaces.
https://tc39.es/ecma262/multipage/ordinary-and-exotic-objects-behaviours.html#typedarray
https://webidl.spec.whatwg.org/#ArrayBufferView
http://web.archive.org/web/20150108144329/https://www.khronos.org/registry/typedarray/specs/latest/