[Issue 2775] "private" ignored for templates

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 9 20:34:04 PST 2010


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


jakobovrum at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakobovrum at gmail.com


--- Comment #1 from jakobovrum at gmail.com 2010-01-09 20:34:03 PST ---
(In reply to comment #0)
> The following compiles successfully, but should result in some sort of "private
> template not accessible" or "no such template in current scope" error:
> 
> // main.d
> import imported;
> void main()
> {
>     char[] str = foo!();
> }
> 
> // imported.d
> private template foo()
> {
>     const char[] foo = "foo";
> }

It happens for templated functions in DMD 2.039, as well.
/*
test.d
*/
module test;

import std.stdio;

class Class
{
    private void foo(T...)(T args)
    {
        writeln("Hello, world!");
    }
}

/*
main.d
*/
module main;

import test;

int main()
{
    scope a = new Class;
    a.foo();
    return 0;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list