Skip to content

Commit

Permalink
Use isReference instead of isRef (#13876)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkorpel committed Mar 24, 2022
1 parent ab7fa79 commit 1c60908
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/dmd/escape.d
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ bool checkAssignEscape(Scope* sc, Expression e, bool gag)

// If va's lifetime encloses v's, then error
if (va &&
(va.enclosesLifetimeOf(v) || (va.isRef() && !(va.storage_class & STC.temp)) || va.isDataseg()) &&
(va.enclosesLifetimeOf(v) || (va.isReference() && !(va.storage_class & STC.temp)) || va.isDataseg()) &&
fd.setUnsafe())
{
if (!gag)
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/expression.d
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ extern (C++) abstract class Expression : ASTNode
return false; // magic variable never violates pure and safe
if (v.isImmutable())
return false; // always safe and pure to access immutables...
if (v.isConst() && !v.isRef() && (v.isDataseg() || v.isParameter()) && v.type.implicitConvTo(v.type.immutableOf()))
if (v.isConst() && !v.isReference() && (v.isDataseg() || v.isParameter()) && v.type.implicitConvTo(v.type.immutableOf()))
return false; // or const global/parameter values which have no mutable indirections
if (v.storage_class & STC.manifest)
return false; // ...or manifest constants
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/func.d
Original file line number Diff line number Diff line change
Expand Up @@ -2779,7 +2779,7 @@ extern (C++) class FuncDeclaration : Declaration
if (auto ve = rs.exp.isVarExp())
{
auto v = ve.var.isVarDeclaration();
if (!v || v.isOut() || v.isRef())
if (!v || v.isReference())
return false;
else if (nrvo_var is null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/dmd/ob.d
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,7 @@ PtrState toPtrState(VarDeclaration v)
*/

auto t = v.type;
if (v.isRef())
if (v.isReference())
{
return t.hasMutableFields() ? PtrState.Borrowed : PtrState.Readonly;
}
Expand Down Expand Up @@ -1775,7 +1775,7 @@ bool hasPointersToMutableFields(Type t)
{
foreach (v; ts.sym.fields)
{
if (v.isRef())
if (v.isReference())
{
if (v.type.hasMutableFields())
return true;
Expand Down

0 comments on commit 1c60908

Please sign in to comment.