[Issue 2120] scope class assignment doesn't copy the whole class content

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu May 22 03:48:14 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2120


davidl at 126.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |




------- Comment #3 from davidl at 126.com  2008-05-22 05:48 -------
I can't find any use case of this in:
http://www.digitalmars.com/d/2.0/class.html

maybe the spec should mention when a class type is not defined as 'scope', the
instance declared with 'scope' keyword, and when a class type is defined as
'scope', the instance declared without 'scope' keyword, how the compiler will
inteprete the semantic.

Clearfying that following code:
class Scope
{
}

void func()
{
   scope Scope t = new Scope(); // t is on the stack(or not) and it will be
deleted(or not) when exit the func scope. And any assignment of instance of
other Scope instance only means the reference assignment. 
}


-- 



More information about the Digitalmars-d-bugs mailing list