Bugzilla – Bug 314300
[PATCH] The argument to the IndexerName attribute must be a valid identifier
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by bmaurer@users.sf.net 2004-04-04 13:28:31 MST ---- We compile: public class MonthDays { [System.Runtime.CompilerServices.IndexerName ("buggypo for you")] public int this [int a] { get { return 0; } } public static void Main () { int i = new MonthDays () [1]; } } csc gives: C:\Inetpub\ftproot>csc t.cs t.cs(2,50): error CS0633: The argument to the IndexerName attribute must be a valid identifier PEVerify gives errors on the exe we generate. ---- Additional Comments From miguel@ximian.com 2004-04-05 23:37:44 MST ---- fixed. ---- Additional Comments From bmaurer@users.sf.net 2004-04-06 00:35:57 MST ---- am reopening it because I know there are corner cases here ("", "\n", and "\0" are there quick examples). I will fix this. ---- Additional Comments From bmaurer@users.sf.net 2004-04-06 00:36:19 MST ---- I hate that it takes two clicks to open + assign ---- Additional Comments From bmaurer@users.sf.net 2004-04-06 00:36:40 MST ---- especially when you make a typo ;-) ---- Additional Comments From ClassDevelopment@A-SoftTech.com 2004-04-06 15:40:49 MST ---- System/System.CodeDom.Compiler/CodeGenerator.cs contains a static method: public static bool IsValidLanguageIndependentIdentifier (string value) Maybe that could be of use here. ---- Additional Comments From bmaurer@users.sf.net 2004-04-06 19:07:19 MST ---- Created an attachment (id=165848) patch ---- Additional Comments From miguel@ximian.com 2004-04-10 15:42:37 MST ---- Applied the patch. Imported an attachment (id=165848) Unknown operating system unknown. Setting to default OS "Other".