"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/dmd/typesem.d" between
dmd-2.094.1.tar.gz and dmd-2.094.2.tar.gz

About: DMD (Digital Mars D) is the D reference compiler. D is an object-oriented, imperative, multi-paradigm system programming language.

typesem.d  (dmd-2.094.1):typesem.d  (dmd-2.094.2)
skipping to change at line 3722 skipping to change at line 3722
s = mt.sym.search(e.loc, ident, flags | IgnorePrivateImports); s = mt.sym.search(e.loc, ident, flags | IgnorePrivateImports);
L1: L1:
if (!s) if (!s)
{ {
return noMember(mt, sc, e, ident, flag); return noMember(mt, sc, e, ident, flag);
} }
if (!(sc.flags & SCOPE.ignoresymbolvisibility) && !symbolIsVisible(sc, s )) if (!(sc.flags & SCOPE.ignoresymbolvisibility) && !symbolIsVisible(sc, s ))
{ {
return noMember(mt, sc, e, ident, flag); return noMember(mt, sc, e, ident, flag);
} }
if (!s.isFuncDeclaration()) // because of overloading
{
s.checkDeprecated(e.loc, sc);
if (auto d = s.isDeclaration())
d.checkDisabled(e.loc, sc);
}
s = s.toAlias(); s = s.toAlias();
if (auto em = s.isEnumMember()) if (auto em = s.isEnumMember())
{ {
return em.getVarExp(e.loc, sc); return em.getVarExp(e.loc, sc);
} }
if (auto v = s.isVarDeclaration()) if (auto v = s.isVarDeclaration())
{ {
v.checkDeprecated(e.loc, sc);
v.checkDisabled(e.loc, sc);
if (!v.type || if (!v.type ||
!v.type.deco && v.inuse) !v.type.deco && v.inuse)
{ {
if (v.inuse) // https://issues.dlang.org/show_bug.cgi?id=9494 if (v.inuse) // https://issues.dlang.org/show_bug.cgi?id=9494
e.error("circular reference to %s `%s`", v.kind(), v.toPrett yChars()); e.error("circular reference to %s `%s`", v.kind(), v.toPrett yChars());
else else
e.error("forward reference to %s `%s`", v.kind(), v.toPretty Chars()); e.error("forward reference to %s `%s`", v.kind(), v.toPretty Chars());
return ErrorExp.get(); return ErrorExp.get();
} }
if (v.type.ty == Terror) if (v.type.ty == Terror)
skipping to change at line 4208 skipping to change at line 4204
TemplateMixin tm = s.isTemplateMixin(); TemplateMixin tm = s.isTemplateMixin();
if (tm) if (tm)
{ {
Expression de = new DotExp(e.loc, e, new ScopeExp(e.loc, tm)); Expression de = new DotExp(e.loc, e, new ScopeExp(e.loc, tm));
de.type = e.type; de.type = e.type;
return de; return de;
} }
TemplateDeclaration td = s.isTemplateDeclaration(); TemplateDeclaration td = s.isTemplateDeclaration();
if (td)
Expression toTemplateExp(TemplateDeclaration td)
{ {
if (e.op == TOK.type) if (e.op == TOK.type)
e = new TemplateExp(e.loc, td); e = new TemplateExp(e.loc, td);
else else
e = new DotTemplateExp(e.loc, e, td); e = new DotTemplateExp(e.loc, e, td);
e = e.expressionSemantic(sc); e = e.expressionSemantic(sc);
return e; return e;
} }
if (td)
{
return toTemplateExp(td);
}
TemplateInstance ti = s.isTemplateInstance(); TemplateInstance ti = s.isTemplateInstance();
if (ti) if (ti)
{ {
if (!ti.semanticRun) if (!ti.semanticRun)
{ {
ti.dsymbolSemantic(sc); ti.dsymbolSemantic(sc);
if (!ti.inst || ti.errors) // if template failed to expand if (!ti.inst || ti.errors) // if template failed to expand
{ {
return ErrorExp.get(); return ErrorExp.get();
} }
skipping to change at line 4358 skipping to change at line 4360
} }
} }
} }
//printf("e = %s, d = %s\n", e.toChars(), d.toChars()); //printf("e = %s, d = %s\n", e.toChars(), d.toChars());
if (d.semanticRun == PASS.init) if (d.semanticRun == PASS.init)
d.dsymbolSemantic(null); d.dsymbolSemantic(null);
// If static function, get the most visible overload. // If static function, get the most visible overload.
// Later on the call is checked for correctness. // Later on the call is checked for correctness.
// https://issues.dlang.org/show_bug.cgi?id=12511 // https://issues.dlang.org/show_bug.cgi?id=12511
Dsymbol d2 = d;
if (auto fd = d.isFuncDeclaration()) if (auto fd = d.isFuncDeclaration())
{ {
import dmd.access : mostVisibleOverload; import dmd.access : mostVisibleOverload;
d = cast(Declaration)mostVisibleOverload(fd, sc._module); d2 = mostVisibleOverload(fd, sc._module);
} }
checkAccess(e.loc, sc, e, d); checkAccess(e.loc, sc, e, d2);
auto ve = new VarExp(e.loc, d); if (d2.isDeclaration())
if (d.isVarDeclaration() && d.needThis()) {
ve.type = d.type.addMod(e.type.mod); d = cast(Declaration)d2;
return ve; auto ve = new VarExp(e.loc, d);
if (d.isVarDeclaration() && d.needThis())
ve.type = d.type.addMod(e.type.mod);
return ve;
}
else if (d2.isTemplateDeclaration())
{
return toTemplateExp(cast(TemplateDeclaration)d2);
}
else
assert(0);
} }
bool unreal = e.op == TOK.variable && (cast(VarExp)e).var.isField(); bool unreal = e.op == TOK.variable && (cast(VarExp)e).var.isField();
if (d.isDataseg() || unreal && d.isField()) if (d.isDataseg() || unreal && d.isField())
{ {
// (e, d) // (e, d)
checkAccess(e.loc, sc, e, d); checkAccess(e.loc, sc, e, d);
Expression ve = new VarExp(e.loc, d); Expression ve = new VarExp(e.loc, d);
e = unreal ? ve : new CommaExp(e.loc, e, ve); e = unreal ? ve : new CommaExp(e.loc, e, ve);
e = e.expressionSemantic(sc); e = e.expressionSemantic(sc);
 End of changes. 7 change blocks. 
13 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)