mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 20:14:01 -06:00
Address PR and add new with exponentiation
This commit is contained in:
parent
bd7cc1e7ef
commit
fbe559eef0
@ -0,0 +1,12 @@
|
||||
tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNew.ts(6,1): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorWithNew.ts (1 errors) ====
|
||||
var a: any;
|
||||
var b: any;
|
||||
var c: any;
|
||||
new a ** b ** c;
|
||||
new a ** new b ** c;
|
||||
new (a ** b ** c);
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
15
tests/baselines/reference/exponentiationOperatorWithNew.js
Normal file
15
tests/baselines/reference/exponentiationOperatorWithNew.js
Normal file
@ -0,0 +1,15 @@
|
||||
//// [exponentiationOperatorWithNew.ts]
|
||||
var a: any;
|
||||
var b: any;
|
||||
var c: any;
|
||||
new a ** b ** c;
|
||||
new a ** new b ** c;
|
||||
new (a ** b ** c);
|
||||
|
||||
//// [exponentiationOperatorWithNew.js]
|
||||
var a;
|
||||
var b;
|
||||
var c;
|
||||
Math.pow(new a, Math.pow(b, c));
|
||||
Math.pow(new a, Math.pow(new b, c));
|
||||
new (Math.pow(a, Math.pow(b, c)));
|
||||
Loading…
x
Reference in New Issue
Block a user