Closed
Description
TypeScript Version: master
Code
function test<T extends number>(n: T) {
var a = n * 1;
var b = n - 1;
var c = n + 1;
}
Expected behavior:
No errors
Actual behavior:
Following errors:
test.ts(4,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
test.ts(5,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
test.ts(6,11): error TS2365: Operator '+' cannot be applied to types 'T' and '1'.