Wiki

Ticket #282 (new enhancement)

Opened 6 years ago

Last modified 4 years ago

Useful compile error (when misusing generics)

Reported by: torial Owned by:
Priority: minor Milestone:
Component: Cobra Compiler Version: 0.8.0
Keywords: Cc:

Description

I work primarily in C#, and so I get used to the C# way of doing generics such as List<int>, and forget the "of" keyword.

When this happens, I get an error: "Expecting an expression" which doesn't really help much and if I'm not remembering this particular issue, I will sometimes hunt down rabbit trails.

If the error message could check to see if angle brackets are used, and then use a message like "Improper generic usage. Use genericType<of T> format." I think it would be helpful.

Change History

Changed 6 years ago by Charles

I totally agree. I actually took a crack at this earlier, but it was not too easy. It's worth a ticket and another try though. Thanks for the report.

Changed 4 years ago by hopscc

See also ticket:118

Note: See TracTickets for help on using tickets.