mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
56 lines
2.5 KiB
Diff
56 lines
2.5 KiB
Diff
--- old.jsDeclarationsFunctionLikeClasses(target=es2015).errors.txt
|
|
+++ new.jsDeclarationsFunctionLikeClasses(target=es2015).errors.txt
|
|
@@= skipped -0, +0 lines =@@
|
|
-referencer.js(7,22): error TS18048: 'p.x' is possibly 'undefined'.
|
|
-referencer.js(7,33): error TS18048: 'p.y' is possibly 'undefined'.
|
|
-
|
|
-
|
|
-==== source.js (0 errors) ====
|
|
+referencer.js(4,12): error TS2749: 'Point' refers to a value, but is being used as a type here. Did you mean 'typeof Point'?
|
|
+source.js(6,11): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
|
|
+source.js(7,16): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.
|
|
+source.js(9,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
|
|
+source.js(10,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
|
|
+
|
|
+
|
|
+==== source.js (4 errors) ====
|
|
/**
|
|
* @param {number} x
|
|
* @param {number} y
|
|
*/
|
|
export function Point(x, y) {
|
|
if (!(this instanceof Point)) {
|
|
+ ~~~~
|
|
+!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
|
|
+!!! related TS2738 source.js:5:17: An outer value of 'this' is shadowed by this container.
|
|
return new Point(x, y);
|
|
+ ~~~~~~~~~~~~~~~
|
|
+!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.
|
|
}
|
|
this.x = x;
|
|
+ ~~~~
|
|
+!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
|
|
+!!! related TS2738 source.js:5:17: An outer value of 'this' is shadowed by this container.
|
|
this.y = y;
|
|
+ ~~~~
|
|
+!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
|
|
+!!! related TS2738 source.js:5:17: An outer value of 'this' is shadowed by this container.
|
|
}
|
|
|
|
-==== referencer.js (2 errors) ====
|
|
+==== referencer.js (1 errors) ====
|
|
import {Point} from "./source";
|
|
|
|
/**
|
|
* @param {Point} p
|
|
+ ~~~~~
|
|
+!!! error TS2749: 'Point' refers to a value, but is being used as a type here. Did you mean 'typeof Point'?
|
|
*/
|
|
export function magnitude(p) {
|
|
return Math.sqrt(p.x ** 2 + p.y ** 2);
|
|
- ~~~
|
|
-!!! error TS18048: 'p.x' is possibly 'undefined'.
|
|
- ~~~
|
|
-!!! error TS18048: 'p.y' is possibly 'undefined'.
|
|
}
|
|
|