mootari opened a new issue, #192:
URL: https://github.com/apache/arrow-js/issues/192

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   Several Generics have `any` set as default value instead of defaulting to 
the type from which they extend, like the following example:
   ```ts
   Field<T extends DataType = any>
   ```
   
   Unfortunately this effectively removes all type guarantees when properties 
that inherit the type are passed down. Example ([playground 
link](https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBDAnmApnA3gMWCgNgEwBo4ARAQxjIBVkUBfOAMyghDgCIywyBjACxQBaMlBYB3dgG4AUNPYA7CPDIJa7OAGcKwDYxwa42PPgDa7JKnYBdSXAD0d0hBQHF8FKOhy3cFRZTqWjA6ei6GOAQAPOSUNKgAfGb+1rYOcACinlAa0kA)):
   ```ts
   import type {Field, DataType} from "apache-arrow";
   
   "not a type" satisfies Field["type"]; // Does not error
   "not a type" satisfies Field<DataType>["type"]; // Errors
   ```
   
   The generics should instead define their base type as default type:
   ```ts
   Field<T extends DataType = DataType>
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to