Skip to content

Report error if class uses extended type before its declaration#4343

Closed
sheetalkamat wants to merge 20 commits into
masterfrom
baseClassDeclarationOrder
Closed

Report error if class uses extended type before its declaration#4343
sheetalkamat wants to merge 20 commits into
masterfrom
baseClassDeclarationOrder

Conversation

@sheetalkamat
Copy link
Copy Markdown
Member

Fixes #4341

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would also add a test with an expression in an extend clause, class A extends foo(0)<string> {}
and one for module aliases

import d from "mod"; 
class B extends d { // no error here
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added this

@sheetalkamat
Copy link
Copy Markdown
Member Author

I am still working on reporting error if alias is declared before it is referencing entity(internal alias only)
Update: its done now.

Comment thread src/compiler/checker.ts Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are they allowed to be in different lexical scopes?

Comment thread src/compiler/checker.ts Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ts.indexOf instead of array.prototype.indexof

Comment thread src/compiler/checker.ts Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix spacing at the end of the line

Comment thread src/compiler/checker.ts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isDefinedBeforeOrAt

@weswigham
Copy link
Copy Markdown
Member

This PR is superseded by #8636 which has been successfully merged, right?

@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Sep 13, 2016

closing in favor of #8636

@mhegazy mhegazy closed this Sep 13, 2016
@mhegazy mhegazy deleted the baseClassDeclarationOrder branch September 13, 2016 22:11
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants