Skip to content

[BUG] t: @struct <T> type doesn't produce a templated class #695

Closed
@leejy12

Description

@leejy12

Compiling the following Cpp2 code

MyStruct: @struct <T> type = {}

produces a non-templated class.

class MyStruct
{
};

Explicitly stating that T is a type parameter resolves this issue, but I wonder if this is the intended behavior.

MyStruct: @struct <T: type> type = {}

compiles to

template <typename T> class MyStruct
{
};

This behavior is in contrast to custom types without the @struct metafunction.

MyClass: <T> type = {}

compiles to

template <typename T> class MyClass
{
public:
    MyClass() = default;

public:
    MyClass(MyClass const&) = delete; /* No 'that' constructor, suppress copy */
public:
    auto operator=(MyClass const&) -> void = delete;
};

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