Skip to content

Commit

Permalink
fix Issue 14116 - Assertion failure: 'p->isPkgMod == PKGmodule' on li…
Browse files Browse the repository at this point in the history
…ne 143 in file 'import.c'
  • Loading branch information
9rnsr committed Feb 3, 2015
1 parent e7b9661 commit 260dba5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/import.c
Expand Up @@ -139,7 +139,10 @@ void Import::load(Scope *sc)
if (!mod)
p->isPkgMod = PKGpackage;
else
assert(p->isPkgMod == PKGmodule);
{
// mod is a package.d, or a normal module which conflicts with the package name.
assert(mod->isPackageFile == (p->isPkgMod == PKGmodule));
}
}
else
{
Expand Down
11 changes: 11 additions & 0 deletions test/fail_compilation/ice14116.d
@@ -0,0 +1,11 @@
// EXTRA_SOURCES: imports/a14116.d
/*
TEST_OUTPUT:
---
fail_compilation/imports/a14116.d(3): Error: module ice14116.ice14116 from file fail_compilation/ice14116.d must be imported with 'import ice14116.ice14116;'
---
*/

module ice14116.ice14116;

void foo() {}
5 changes: 5 additions & 0 deletions test/fail_compilation/imports/a14116.d
@@ -0,0 +1,5 @@
module ice14116.a14116;

import ice14116;

void main() {}

0 comments on commit 260dba5

Please sign in to comment.