Skip to content

Commit

Permalink
Fix Issue 6319 - debug's relaxed purity does not apply to nested scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
yebblies committed Jan 16, 2013
1 parent 4c52f07 commit fc45fef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/scope.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Scope::Scope(Scope *enclosing)
this->speculative = enclosing->speculative;
this->parameterSpecialization = enclosing->parameterSpecialization;
this->callSuper = enclosing->callSuper;
this->flags = (enclosing->flags & SCOPEcontract);
this->flags = (enclosing->flags & (SCOPEcontract | SCOPEdebug));
this->lastdc = NULL;
this->lastoffset = 0;
this->docbuf = enclosing->docbuf;
Expand Down
13 changes: 13 additions & 0 deletions test/compilable/test6319.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// REQUIRED_ARGS: -debug

int x;

void main() pure
{
debug
{
{
x = 0;
}
}
}

0 comments on commit fc45fef

Please sign in to comment.