Lars Fosdal 1792 Posted August 26, 2021 Is this a known issue? If you assign an anonymous function to a property, there is no warning if the result of the function is not defined. Normally, a function where Result is not set will yield a warning. program anon_method_func_result; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; type TConvertFunc<T> = reference to function(const invalue: string; out outvalue: T): Boolean; TValue<T> = class private FConverter: TConvertFunc<T>; public property Converter: TConvertFunc<T> read FConverter write FConverter; constructor Create; end; constructor TValue<T>.Create; begin FConverter := function(const inValue: string; out outvalue: T): Boolean begin outvalue := Default(T); // Would have expected a warning here // since Result is never set end; end; begin try try var V := TValue<Integer>.Create; V.Free; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; finally {$ifdef Debug} Write('Press Enter: '); Readln; {$endif} end; end. Share this post Link to post
Stefan Glienke 2002 Posted August 26, 2021 This issue is as old as generics are: https://quality.embarcadero.com/browse/RSP-10506 1 3 Share this post Link to post
Lars Fosdal 1792 Posted August 26, 2021 Well, I voted now, because I got bit by it. Share this post Link to post
FredS 138 Posted August 26, 2021 3 hours ago, Stefan Glienke said: as old as generics Can't expect 'em to implement a new feature in under 5 years now.. 3 Share this post Link to post
Guest Posted September 2, 2021 (edited) Ouch. Thx!!!, one thingy off my plate. I vas bitten too. Did not have the time to dig in to that at that moment. Delphipraxis shows its use case again! Edited September 2, 2021 by Guest Share this post Link to post
Vincent Parrett 750 Posted September 2, 2021 On 8/27/2021 at 12:34 AM, FredS said: Can't expect 'em to implement a new feature in under 5 years now.. And another 5 for it to actually work properly. 1 Share this post Link to post
Vandrovnik 214 Posted September 3, 2021 On 8/26/2021 at 4:34 PM, FredS said: Can't expect 'em to implement a new feature in under 5 years now.. This one was created on 11/Mar/15 🙂 Share this post Link to post
Guest Posted September 3, 2021 3 hours ago, Vandrovnik said: This one was created on 11/Mar/15 🙂 Please use ISO dates. I would have to do some research in order to know if you mean 2011-03-15 or 2015-03-11. I would have to do research even to know if the "/" is information enough or if i need to know your "locale". Share this post Link to post
Vandrovnik 214 Posted September 3, 2021 (edited) 2 minutes ago, Dany Marmur said: Please use ISO dates. I would have to do some research in order to know if you mean 2011-03-15 or 2015-03-11. I would have to do research even to know if the "/" is information enough or if i need to know your "locale". I just copies it from https://quality.embarcadero.com/browse/RSP-10506 I suppose it was created in 2015, but I would believe in 2011, too 🙂 Edited September 3, 2021 by Vandrovnik 1 Share this post Link to post
Fr0sT.Brutal 900 Posted September 3, 2021 29 minutes ago, Dany Marmur said: Please use ISO dates 2015-03-11T23:04:42.837Z Share this post Link to post