Added 'any' cast in 'tcomb'.

This commit is contained in:
Daniel Rosenwasser
2015-08-20 12:38:05 -07:00
parent bfeb69f3e3
commit 69a9179293
+3 -4
View File
@@ -577,17 +577,16 @@ describe('irreducible types constructors', function () {
{T: Dat, x: new Date()}
].forEach(function (o) {
var T = o.T;
var x = o.x;
var { T, x } = o;
it('should accept only valid values', function () {
eq(T(x), x);
eq((<any>T)(x), x);
});
it('should throw if used with new', function () {
throwsWithMessage(function () {
/* jshint ignore:start */
var x = new (<any>T) ();
var x = new (<any>T) ();
/* jshint ignore:end */
}, 'Operator `new` is forbidden for type `' + getTypeName(T) + '`');
});