diff --git a/source/dyaml/representer.d b/source/dyaml/representer.d index f90f7f4..6a88ee5 100644 --- a/source/dyaml/representer.d +++ b/source/dyaml/representer.d @@ -224,10 +224,11 @@ final class Representer * } * -------------------- */ - void addRepresenter(T)(Node function(ref Node, Representer) representer) @trusted + void addRepresenter(T)(Node function(ref Node, Representer) representer) + @trusted pure { assert((typeid(T) in representers_) is null, - "Representer function for data type " ~ typeid(T).toString() ~ + "Representer function for data type " ~ T.stringof ~ " already specified. Can't specify another one"); representers_[typeid(T)] = representer; }