dotless/dotless — Issue #136: Similar name on mixin inside classname gives .NET Framework Exception.
Author: olemarius
Created: 2012-02-24 13:40:55+00:00
State: open

If you have a mixin named .clearfix() { ... } then a class called .clearfix with the clearfix inside, it'll throw an exception. Here's the code that triggered it, on dotless 1.2.2.

.clearfix() {
// For IE 6/7 (trigger hasLayout)
zoom:1;
// For modern browsers
&:before {
content:"";
display:table;
}
&:after {
content:"";
display:table;
}
&:after {
clear:both;
}
}
.clearfix {
.clearfix();
}

The exact error message is a popup with:

An unhandled Microsoft .NET Framework exception occurred in w3wp.exe [7552].

Let me know if you need any additional information. A workaround would be to just call the class name something else :-)