Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional tests for bug 22292 #13131

Merged
merged 1 commit into from Oct 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
64 changes: 64 additions & 0 deletions test/compilable/test22292.d
Expand Up @@ -89,3 +89,67 @@ template Test3()
}

alias test3 = Test3!();

// From https://issues.dlang.org/show_bug.cgi?id=22114

template Test4()
{
public class Test1(T)
{
private Test2!T val;

this()
{
val = new Test2!T(this);
}

private class Test2(T)
{
private Test1!(T) m_source;

this(Test1!T source)
{
m_source = source;
}
}
}

public class Demo
{
auto val = new Test1!int();
}
}

alias test4 = Test4!();

// ditto

template Test5()
{
public @nogc class TestA(T)
{
private TestB!T valA;
private TestB!T valB;
this()
{
valB = valA = new TestB!T(this);
}

private @nogc class TestB(T)
{
private TestA!(T) m_source;

this(TestA!T source)
{
m_source = source;
}
}
}

public class Demo
{
auto val = new TestA!int();
}
}

alias test5 = Test5!();