Skip to content

Commit

Permalink
Merge pull request #47 from thewilsonator/patch-1
Browse files Browse the repository at this point in the history
Fix errors of the form "Error: scope variable `o` assigned to non-sco…
  • Loading branch information
maxhaton authored Aug 25, 2021
2 parents 92fbb2c + 8578341 commit caeedcd
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/undead/xml.d
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ class Document : Element
*/
override bool opEquals(scope const Object o) const
{
const doc = toType!(const Document)(o);
const scope doc = toType!(const Document)(o);
return prolog == doc.prolog
&& (cast(const) this).Element.opEquals(cast(const) doc)
&& epilog == doc.epilog;
Expand All @@ -611,7 +611,7 @@ class Document : Element
*/
override int opCmp(scope const Object o) scope const
{
const doc = toType!(const Document)(o);
const scope doc = toType!(const Document)(o);
if (prolog != doc.prolog)
return prolog < doc.prolog ? -1 : 1;
if (int cmp = this.Element.opCmp(doc))
Expand Down Expand Up @@ -842,7 +842,7 @@ class Element : Item
*/
override bool opEquals(scope const Object o) const
{
const element = toType!(const Element)(o);
const scope element = toType!(const Element)(o);
immutable len = items.length;
if (len != element.items.length) return false;
foreach (i; 0 .. len)
Expand All @@ -866,7 +866,7 @@ class Element : Item
*/
override int opCmp(scope const Object o) @safe const
{
const element = toType!(const Element)(o);
const scope element = toType!(const Element)(o);
for (uint i=0; ; ++i)
{
if (i == items.length && i == element.items.length) return 0;
Expand Down Expand Up @@ -1277,7 +1277,7 @@ class Comment : Item
*/
override bool opEquals(scope const Object o) const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const Comment) item;
return t !is null && content == t.content;
}
Expand All @@ -1296,7 +1296,7 @@ class Comment : Item
*/
override int opCmp(scope const Object o) scope const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const Comment) item;
return t !is null && (content != t.content
? (content < t.content ? -1 : 1 ) : 0 );
Expand Down Expand Up @@ -1365,7 +1365,7 @@ class CData : Item
*/
override bool opEquals(scope const Object o) const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const CData) item;
return t !is null && content == t.content;
}
Expand All @@ -1384,7 +1384,7 @@ class CData : Item
*/
override int opCmp(scope const Object o) scope const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const CData) item;
return t !is null && (content != t.content
? (content < t.content ? -1 : 1 ) : 0 );
Expand Down Expand Up @@ -1442,7 +1442,7 @@ class Text : Item
*/
override bool opEquals(scope const Object o) const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const Text) item;
return t !is null && content == t.content;
}
Expand All @@ -1461,7 +1461,7 @@ class Text : Item
*/
override int opCmp(scope const Object o) scope const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const Text) item;
return t !is null
&& (content != t.content ? (content < t.content ? -1 : 1 ) : 0 );
Expand Down Expand Up @@ -1525,7 +1525,7 @@ class XMLInstruction : Item
*/
override bool opEquals(scope const Object o) const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const XMLInstruction) item;
return t !is null && content == t.content;
}
Expand All @@ -1544,7 +1544,7 @@ class XMLInstruction : Item
*/
override int opCmp(scope const Object o) scope const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const XMLInstruction) item;
return t !is null
&& (content != t.content ? (content < t.content ? -1 : 1 ) : 0 );
Expand Down Expand Up @@ -1605,7 +1605,7 @@ class ProcessingInstruction : Item
*/
override bool opEquals(scope const Object o) const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const ProcessingInstruction) item;
return t !is null && content == t.content;
}
Expand All @@ -1624,7 +1624,7 @@ class ProcessingInstruction : Item
*/
override int opCmp(scope const Object o) scope const
{
const item = toType!(const Item)(o);
const scope item = toType!(const Item)(o);
const t = cast(const ProcessingInstruction) item;
return t !is null
&& (content != t.content ? (content < t.content ? -1 : 1 ) : 0 );
Expand Down

0 comments on commit caeedcd

Please sign in to comment.