dormky 1 Posted July 11 (edited) Done using https://www.onlinegdb.com/online_pascal_compiler, but Delphi 10.3 does the same. What the fork ? Edited July 11 by Sherlock Rephrased Share this post Link to post
Dave Nottage 542 Posted July 11 18 minutes ago, dormky said: What the ****? Please keep the profanity out. Delphi treats the constant in that statement as a set. See this. 4 Share this post Link to post
David Heffernan 2330 Posted July 11 Classic delphi type ambiguity consequence Share this post Link to post
Uwe Raabe 1992 Posted July 11 A workaround would be to declare the array as a constant or create a dynamic array on the fly: for I in TArray<Integer>.Create(45, 30, 15) do Share this post Link to post
Brandon Staggs 236 Posted July 11 Why oh why would you write a for statement like that? As others already said, you're declaring a set, so you are getting the expected behavior. I presume in your mind you expect it to be treated like an array. If that is the case, then you need to use an array instead of a set. Share this post Link to post
Der schöne Günther 312 Posted July 11 (edited) In cases like this, I really love code editors and environments that can tell me right away to what type something infers by just tapping Ctrl+Alt... Edited July 11 by Der schöne Günther Share this post Link to post
David Heffernan 2330 Posted July 12 12 hours ago, Der schöne Günther said: In cases like this, I really love code editors and environments that can tell me right away to what type something infers by just tapping Ctrl+Alt... Code editors telling you stuff is great but the bigger problem is the missing functionality at the fundamental language level. Share this post Link to post