mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
49 lines
973 B
TypeScript
49 lines
973 B
TypeScript
//// [tests/cases/compiler/autolift4.ts] ////
|
|
|
|
//// [autolift4.ts]
|
|
class Point {
|
|
|
|
constructor(public x: number, public y: number) {
|
|
|
|
}
|
|
getDist() {
|
|
return Math.sqrt(this.x*this.x + this.y*this.y);
|
|
}
|
|
static origin = new Point(0,0);
|
|
}
|
|
|
|
class Point3D extends Point {
|
|
|
|
constructor(x: number, y: number, public z: number, m:number) {
|
|
super(x, y);
|
|
}
|
|
|
|
getDist() {
|
|
return Math.sqrt(this.x*this.x + this.y*this.y + this.z*this.m);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//// [autolift4.js]
|
|
"use strict";
|
|
class Point {
|
|
constructor(x, y) {
|
|
this.x = x;
|
|
this.y = y;
|
|
}
|
|
getDist() {
|
|
return Math.sqrt(this.x * this.x + this.y * this.y);
|
|
}
|
|
}
|
|
Point.origin = new Point(0, 0);
|
|
class Point3D extends Point {
|
|
constructor(x, y, z, m) {
|
|
super(x, y);
|
|
this.z = z;
|
|
}
|
|
getDist() {
|
|
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.m);
|
|
}
|
|
}
|