Skip to content

Class inherits a class defined just below fails in js side but no error shown in ts side #6526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TadasPa opened this issue Jan 18, 2016 · 3 comments
Labels
Bug A bug in TypeScript Duplicate An existing issue was already created

Comments

@TadasPa
Copy link

TadasPa commented Jan 18, 2016

TS:

class A extends B { }
class B { }
// no TS errors here

JS:

var A = (function (_super) {
        __extends(A, _super);
        function A() {
            _super.apply(this, arguments);
        }
        return A;
    })(B);
var B = (function () {
        function B() {
        }
        return B;
    })();

When "__extends(A, _super);" is called "_super" is not defined yet and it's prototype, of course. I guess TS side should complain or JS should be reordered.

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Jan 19, 2016
@RyanCavanaugh
Copy link
Member

There are about eleventybillion dupes on this but I thought we had fixed this already. Vlad says we can probably use isBlockScopedNameDeclaredBeforeUse to implement this very cheaply.

@mhegazy mhegazy added this to the TypeScript 2.0 milestone Jan 20, 2016
@drake7707
Copy link

Also see #4341

@mhegazy
Copy link
Contributor

mhegazy commented Feb 24, 2016

closing in favor of #5207

@mhegazy mhegazy closed this as completed Feb 24, 2016
@mhegazy mhegazy added the Duplicate An existing issue was already created label Feb 24, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

5 participants