Commit 347f5c88 by Iain Buclaw

re PR d/90651 (ICE in FuncDeclaration::semantic3, at d/dmd/func.c:1524)

	PR d/90651
d/dmd: Merge upstream dmd 78dc31152

Fixes bug where the object module was not always implicitly imported.

Reviewed-on: https://github.com/dlang/dmd/pull/9999

From-SVN: r272340
parent e62b9f8e
bbc5ea66ab41ebd14abd9a0fbb9ca6ef6b2dcb14 78dc311524341a76008b341ff6427e5a16e285db
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository. merge done from the dlang/dmd repository.
...@@ -679,7 +679,8 @@ void Module::importAll(Scope *) ...@@ -679,7 +679,8 @@ void Module::importAll(Scope *)
// If it isn't there, some compiler rewrites, like // If it isn't there, some compiler rewrites, like
// classinst == classinst -> .object.opEquals(classinst, classinst) // classinst == classinst -> .object.opEquals(classinst, classinst)
// would fail inside object.d. // would fail inside object.d.
if (members->dim == 0 || ((*members)[0])->ident != Id::object) if (members->dim == 0 || ((*members)[0])->ident != Id::object ||
(*members)[0]->isImport() == NULL)
{ {
Import *im = new Import(Loc(), NULL, Id::object, NULL, 0); Import *im = new Import(Loc(), NULL, Id::object, NULL, 0);
members->shift(im); members->shift(im);
......
// PERMUTE_ARGS:
import object;
void fun(string) { }
// PERMUTE_ARGS:
/*
TEST_OUTPUT:
---
fail_compilation/fail19912a.d(8): Error: struct `fail19912a.object` conflicts with import `fail19912a.object` at fail_compilation/fail19912a.d
---
*/
struct object { }
void fun(string) { }
// PERMUTE_ARGS:
/*
TEST_OUTPUT:
---
fail_compilation/fail19912b.d(8): Error: class `fail19912b.object` conflicts with import `fail19912b.object` at fail_compilation/fail19912b.d
---
*/
class object { }
void fun(string) { }
// PERMUTE_ARGS:
/*
TEST_OUTPUT:
---
fail_compilation/fail19912c.d(8): Error: alias `fail19912c.object` conflicts with import `fail19912c.object` at fail_compilation/fail19912c.d
---
*/
alias object = int;
void fun(string) { }
// PERMUTE_ARGS:
/*
TEST_OUTPUT:
---
fail_compilation/fail19912d.d(8): Error: enum `fail19912d.object` conflicts with import `fail19912d.object` at fail_compilation/fail19912d.d
---
*/
enum object { }
void fun(string) { }
// PERMUTE_ARGS:
/*
TEST_OUTPUT:
---
fail_compilation/fail19912e.d(8): Error: function `fail19912e.object` conflicts with import `fail19912e.object` at fail_compilation/fail19912e.d
---
*/
void object() { }
void fun(string) { }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment