Skip to content

Do not report errors for classes and interfaces merging #5290

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

Merged
merged 2 commits into from
Oct 16, 2015

Conversation

mhegazy
Copy link
Contributor

@mhegazy mhegazy commented Oct 16, 2015

As discussed in #5269, this removes the restriction for non-ambient classes merging with interfaces.



var bar = new Bar();
bar.classFooMethod().interfaceFooMethod().classBarMethod().classFooMethod();
Copy link
Member

Choose a reason for hiding this comment

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

I kind of expected the last method to be interfaceBarMethod(); since all the others are used and classFooMethod() appears twice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@sandersn
Copy link
Member

One small comment, otherwise 👍

// Checking class with other things in type space not value space

// class then interface
class c11 { // error
~~~
!!! error TS2518: Only an ambient class can be merged with an interface.
foo() {
return 1;
}
}

interface c11 { // error
Copy link
Member

Choose a reason for hiding this comment

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

Remove // error comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@ahejlsberg
Copy link
Member

👍

mhegazy added a commit that referenced this pull request Oct 16, 2015
Do not report errors for classes and interfaces merging
@mhegazy mhegazy merged commit bb369f1 into master Oct 16, 2015
@mhegazy mhegazy deleted the interfaceClassMergingFix branch October 16, 2015 23:45
@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