Skip to content

[BUG] Generic Struct<T> with Option<T*> doesn't transpile #311

@borup3

Description

@borup3

Describe the bug
I added this to tests/language/generics/test_generic_loop_instantiation.zc to verify.

struct List<G> {
    data: G*
}

impl List<G> {
    fn this_works(self) -> Option<G> { // Option<G> resolves properly
        let item = self.data[0];
        let _opt = Option<G>::Some(item);
        return _opt;
    }

    fn this_doesnt_work(self) -> Option<G*> { // Option<G*> fails to resolve
        let item = &self.data[0];
        let _opt = Option<G*>::Some(item);
        return _opt;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions