0
votes
Vote UpVote

Workaround for Delphi 2010 compiler error “E2076 This form of method call only allowed for class methods” when it infers a generic parameter type.

The Wiert Corner – Generic support in Delphi took a very long time to get stabilised. Which means that compilers older than Delphi XE2 are hardly usable for code using generics. XE did get better, but Delphi 2010 and especially Delphi 2009 were hopeless. A while ago, I bumped into another subtle error “E2076 This form of method call only allowed for class methods” when back-porting to Delphi 2010 the code like below calling the Spring4D unit Spring.SystemUtils which has a TEnum class that includes this TEnum.GetName<T> method: class function GetName<T>(const value: T): string; ...
Favorite? Off-Topic? jpluimers @ 2015-09-10 07:00

Statistics

Visits: 887
Votes: 0
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)