Skip to content

[BUG] @metaclass prevents type inheriting #453

Open
@realgdman

Description

@realgdman

Having this: Base prevents type with some @meta from compiling

Reproduce Code

EmptyBase: type = {}
BaseBV: @basic_value type = {}
BV_BV: @basic_value type = { this: BaseBV; } //error
BV_B: @basic_value type = { this: EmptyBase; } //error
I_B: @interface type = { this: EmptyBase; } //error

https://cpp2.godbolt.org/z/Y5sY4a39G

Version
latest (38aec57)

Command lines
cppfront/cppfront $1.cpp2 -p
clang++-15 -Icppfront/include $1.cpp -std=c++20 -o $1

Expected result
Successful compilation or clearer diagnostic if that's intended

Actual result
@basic_value or @value or @struct:
error: expected 'BaseBV = ...' initialization statement - an operator= body must start with a series of 'member = value;'

@interface:
error: while applying @interface - interfaces may not contain data objects

Additional context
This is specifically about what seems as valid combinations, like @interface::@interface

I'm not talking about impossible combinations, like @polymorphic_base::@copyable, that could be another issue.

Which actually compiles, giving cpp1 warning about

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions