Skip to content

{.inheritable.} does not work for generic objects #1515

Open
@alaviss

Description

@alaviss

Example

type
  X[T] {.inheritable.} = object
  Y = object of X[int]

Actual Output

test.nim(3, 14) Error: inheritance only works with non-final objects; for X[system.int] to be inheritable it must be 'object of RootObj' instead of 'object'

Expected Output

There should be no errors

Additional Information

  • This works fine in mainline Nim
  • I'm using this in union.nim to create virtual object roots for generics matching.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcompiler/semRelated to semantic-analysis system of the compiler

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions