TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Nitin Bhardwaj
NA
15.9k
13m
Constructor Overloading in TypeScript
Nov 1 2012 11:35 AM
Hi,
Can we constructor overloading in TypeScript?
Reply
Answers (
1
)
0
Vulpes
0
96k
2.6m
Nov 1 2012 12:42 PM
Well, you can overload constructors but the problem is that only one of the constructors can have an implementation!
If follows that the latter must have a signature which is compatible with all of the other constructors.
It seems to me that there's little point in defining additional constructors in these circumstances.
There are some examples in this thread:
http://stackoverflow.com/questions/12702548/constructor-overload-in-typescript
Accepted Answer
Use of TypeScript
Compilation problem in TypeScript