dethcrypto / dethcrypto/TypeChain

Preserve inheritance

Open
#684 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2.8k
Forks
376
PR merge metrics
No merged PRs in 30d

Description

With contract code like `contract Car is GroundVehicle` and `contract Truck is GroundVehicle` I get types generated for `CarInstance` and `TruckInstance` and `GroundVehicleInstance` but when I have a function expecting a `GroundVehicleInstance` I can't pass in the `CarInstance` without a type error. This is because the types returned by a given function are incompatible: `Type 'import("path/to/Car").AllEvents' is not assignable to type 'import("path/to/GroundVehicle").AllEvents'.` Those incompatible types are the generic parameter to the Promise> type used in responses to functions.

This code would be much more useful if the inheritance could be preserved and used in that way.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.