[Issue 4197] __error iso assert failure in struct function in/out statement

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 16 10:48:21 PDT 2010


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


Justin Spahr-Summers <Justin.SpahrSummers at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Justin.SpahrSummers at gmail.c
                   |                            |om


--- Comment #1 from Justin Spahr-Summers <Justin.SpahrSummers at gmail.com> 2010-05-16 12:48:17 CDT ---
(In reply to comment #0)
> module main;
> 
> const S S1 = S();
> 
> struct S 
> {
>   static S func( S s_ )
>   in{ assert(false,random); }
>   out(result){ assert(false,random); }
>   body{ return s_; }
> 
>   const S S2 = func(S());
> }
> void main(){}
> --
> main.d(8): Error: __error <---# should be assert failure #
> main.d(12): Error: cannot evaluate func((S())) at compile time

The second argument to assert() - if present - is supposed to be a string
describing the condition. The error message without the second parameter or
with a string there instead is correct.

-- 
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