D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7037 - TemplateTypeParameterSpecialization works differently from IsExpression regarding alias this
Summary: TemplateTypeParameterSpecialization works differently from IsExpression regar...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: patch, rejects-valid
Depends on:
Blocks:
 
Reported: 2011-11-30 03:15 UTC by Simen Kjaeraas
Modified: 2011-12-20 11:07 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 Simen Kjaeraas 2011-11-30 03:15:03 UTC
struct Foo {}
struct Bar {
    Foo f;
    alias f this;
}
void works( T )( T value ) if ( is( T : Foo ) ) {}
void doesnotwork( T : Foo )( T value ) {}

void main( ) {
    Bar b;
    works( b );
    doesnotwork( b );
}


The 'works' function runs without problem, 'doesnotwork' does (can you guess?) not work.