We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
TypeScript Version: 3.3.0-dev.201xxxxx
Search Terms:
class, nominal typing, structural typing Code
interface A { color:string } interface B { color:string } const b:B = { color:'red' } function foo(a:A){ return String(a) } foo(b) class AA{ constructor(color:string){ this.color=color } color:string } class BB{ constructor(color:string){ this.color=color } color:string } const bb = new BB('red') function bar(a:AA){ return String(a) } bar(bb)
Expected behavior:
class should be nominal typing, show error in bar(bb)
bar(bb)
Actual behavior:
class be structural typing, no error
Playground Link:
structural typing & nominal typing
The text was updated successfully, but these errors were encountered:
Duplicate/related to #202, #12936 and PR #28749.
Sorry, something went wrong.
P.S. @j-oliveras I really appreciate you helping out with these issues
No branches or pull requests
TypeScript Version: 3.3.0-dev.201xxxxx
Search Terms:
class, nominal typing, structural typing
Code
Expected behavior:
class should be nominal typing,
show error in
bar(bb)
Actual behavior:
class be structural typing,
no error
Playground Link:
structural typing & nominal typing
The text was updated successfully, but these errors were encountered: