After experimenting, I noticed that having Code := causes the error.
Then I spotted that PriceRow does not have a member called Code.
Using the correct field name makes the code compile. So it seems that instead of producing a sensible error about the incorrect member name, the compiler faulted somewhere.
Combined with intellisense not working, complete class not working, go to interface/implementation not working, syntax highlighting being all over the place, and having to restart VS every few minutes because strange things start to happen, I’m really not enjoying Oxygene as an experience
result := Instruments
.Where(i -> (not i.IsSterling or IncludeSterling))
.Where(i -> (not i.IsDecember or IncludeDecembers))
.Select(i -> new HaverPriceRow(
DateStamp := dateStamp,
Contract := String.Format(‘X{0}{1}’, MetalCode, i.Code),
Bid := PriceData.Item(i.BidField), // 263
Ask := PriceData.Item(i.AskField) // 264
)
);
Error 4 (E318) No overloaded method “get_Item” with 0 parameters on type “System.Collections.Generic.Dictionary<System.String,System.Object>” C:\Projects\Delphi Prism XE2\Feeds\App_Code\CustomFeeds\HaverPrices.pas 263
Error 5 (E318) No overloaded method “get_Item” with 0 parameters on type “System.Collections.Generic.Dictionary<System.String,System.Object>” C:\Projects\Delphi Prism XE2\Feeds\App_Code\CustomFeeds\HaverPrices.pas 264
Combined with intellisense not working, complete class not working, go to interface/implementation not working, syntax highlighting being all over the place, and having to restart VS every few minutes because strange things start to happen, I'm really not enjoying Oxygene as an experience :(
These are all related. if syntax highlighting fails the parser state is broken and complete class, intellisense, goto intf/impl are too. Once I have your project i can test this.
By the way, I am stuck trying to deliver an update to this project to a client, so if you have any interim suggestions for workarounds etc they would be much appreciated!
reproduced both; the no overload for item() is a code error. Dictionary has an item array property that needs to be accessed with [] not (). Fixing the other one.
@ck ahh right thanks. Will try it. That’s my C# showing On the same line though when I used PriceData[i.BidField] was when I got the “Error 8 (E0) Internal error: EC Cannot Simplify Identifier” problem. Is that related to the records vs. classes too?