accepts-invalid?

Nick Sabalausky a at a.a
Mon Aug 23 13:11:44 PDT 2010


"Steven Schveighoffer" <schveiguy at yahoo.com> wrote in message 
news:op.vhwolemleav7ka at localhost.localdomain...
> On Mon, 23 Aug 2010 15:29:32 -0400, Nick Sabalausky <a at a.a> wrote:
>
>> "klickverbot" <see at klickverbot.at> wrote in message
>> news:i4ualh$1qh1$1 at digitalmars.com...
>>> Hello all,
>>>
>>> currently, DMD accepts the following code, but the resulting binary
>>> bus-errors at runtime:
>>>
>>> ---
>>> import std.stdio;
>>>
>>> void foo( string str ) () {
>>>     writefln( str );
>>> }
>>>
>>> void bar( string text ) {
>>>     foo!( text );
>>> }
>>>
>>> void main() { bar( "asdf" );
>>> }
>>> ---
>>>
>>> Shouldn't this be a compile-time error?
>>>
>>
>> I'm pretty sure that should work fine in D1 without any errors. Although 
>> on
>> 1.062 I'm getting this (at run-time):
>>
>> ---------------------------------------
>> Error: 4invalid UTF-8 sequence
>> 1
>> ---------------------------------------
>
> Wait, how can you pass a runtime string as a template parameter?  I'm 
> pretty sure the whole thing is a bug.
>

Oh, yea, now I see it :)




More information about the Digitalmars-d mailing list