From 01a8d9ab5431e6632eef539fa9849e83942d855a Mon Sep 17 00:00:00 2001 From: k-hara Date: Sat, 24 Mar 2012 12:51:57 +0900 Subject: [PATCH] Add static assert --- std/typecons.d | 1 + 1 file changed, 1 insertion(+) diff --git a/std/typecons.d b/std/typecons.d index 36ddd247d..59578e217 100644 --- a/std/typecons.d +++ b/std/typecons.d @@ -2772,6 +2772,7 @@ mixin template Proxy(alias a) { auto ref opEquals(this X)(auto ref typeof(this) b) { + static assert(a.stringof.startsWith("this.")); return a == mixin("b."~a.stringof[5..$]); // remove "this." } auto ref opEquals(this X, B)(auto ref B b) if (!is(B == typeof(this)))