D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1776 - template,version,static if
Summary: template,version,static if
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-10 03:24 UTC by Hiroki Ito
Modified: 2015-06-09 01:14 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Hiroki Ito 2008-01-10 03:24:19 UTC
----- test.d -----
class C {
   version( VER_A ) {
       void foo(T)( T[] data) {
           static if( is( T == ushort) || is( T == uint) ) {
	   } else {
	       static assert( false );
	   }
       }
   }
}
-----

compile with -c option

----- test.di -----
    template init(T)
{
void foo( T[] data)
{
static if(is(T == ushort) || is(T == uint))
else
static assert(false);
}
}

----

error
"found 'else' instead of statement"
Comment 1 Stewart Gordon 2008-09-09 16:09:29 UTC
What exactly is the bug you're reporting?

(a) that some unspecified process is generating this syntactically incorrect .di file?  IWC please give the full command line, and double-check that the .d file you posted really is exactly the one you used.

(b) that the error message is missing its filename/line number?

(c) something else entirely?
Comment 2 Don 2009-09-11 05:52:26 UTC
The original bug was that dmd -H test.d produced the defective test.di file.
This was fixed in dmd1.039 or 1.041. Fixed in D2 at the same time.