Skip to content

Rust inheritance is broken #5372

@hansl

Description

@hansl

Currently, a JS class can inherit from a Rust class, a Js class can inherit from a JS class, but a Rust class cannot inherit from anything other than the base prototype.

This has been broken for at least a year, likely forever. Rust classes (specifically JsClass implementors), cannot specify a base class anywhere.

Two things might need some consideration:

  1. can downcast_ref be broken if the same JsClass implementor appears twice in the prototype chain?
  2. there are multiple specifications of prototype property in JsObject and JsPrototype. It's confusing, but necessary (prototype of constructor and prototype of instances). They have separate properties/arguments now when creating new objects, but it's unclear if they even work the way they're supposed to.

Either of those can change the public API, so I'm marking it as blocking 1.0.

Metadata

Metadata

Assignees

Labels

A-BugSomething isn't working

Type

No fields configured for Bug.

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions