mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-10 11:40:16 +08:00
Added 'any' cast in 'tcomb'.
This commit is contained in:
@@ -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) + '`');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user