D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7422 - Regression(master): ICE with template function and if statement
Summary: Regression(master): ICE with template function and if statement
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 regression
Assignee: No Owner
URL:
Keywords: ice
Depends on:
Blocks:
 
Reported: 2012-02-01 14:55 UTC by Robert Clipsham
Modified: 2012-02-06 00:16 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Robert Clipsham 2012-02-01 14:55:31 UTC
The following:
----
struct Logger {
    static void info()() {
    }
}

void view() {
    if (Logger.info) {
    }
}
----
ICEs with git master @ dc7916071b60739dcc8c09e43ff3da5218b42ff2, giving the following error:
dmd: statement.c:2520: virtual Statement* IfStatement::semantic(Scope*): Assertion `condition->type' failed.
Aborted

On linux x86_32. Note this still occurs if you make this into a valid test case by overloading the info() method with one that returns bool.
Comment 1 github-bugzilla 2012-02-06 00:16:15 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/a4906de97388b62aa7e7ed842e369826d36fbb9c
fix Issue 7422 - Regression(master): ICE with template function and if statement