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

Add test case for issue 13197 #12786

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions test/compilable/imports/test13197/a.d
@@ -0,0 +1,15 @@
module imports.test13197.a;

import imports.test13197.y; // import class C
import imports.test13197.y.z; // import class D : C

void g()
{
C c;
c.f(); // no problem, C is declared in the same package

D d;
d.f(); // error! D doesn't define f(), C does, and we have access to C as demonstrated above
}


10 changes: 10 additions & 0 deletions test/compilable/imports/test13197/y.d
@@ -0,0 +1,10 @@
module imports.test13197.y;

class C
{
package:
void f()
{
}
}

6 changes: 6 additions & 0 deletions test/compilable/imports/test13197/y/z.d
@@ -0,0 +1,6 @@
module imports.test13197.y.z;

import imports.test13197.y;
class D : C
{
}
11 changes: 11 additions & 0 deletions test/compilable/issue13197.d
@@ -0,0 +1,11 @@
/**
EXTRA_SOURCES: imports/test13197/a.d imports/test13197/y/package.d imports/test13197/y/z.d
*/
// https://issues.dlang.org/show_bug.cgi?id=13197
module issue13197;

import imports.test13197.a;

void test() { g(); }