Bugzilla – Bug 318249
[PATCH] Newline in character literal should trigger CS1010 error
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by brion@pobox.com 2005-06-13 02:05:15 MST ---- Description of Problem: Newlines are forbidden in single-quoted character literals according to the spec (ECMA-344 9.4.4.4), but mcs accepts this construct. Steps to reproduce the problem: 1. char x=' '; 2. Save source file in Unix line-ending format. 2. mcs foo.cs Actual Results: MCS compiles this without complaint. Expected Results: This should probably trigger a CS1010 'Newline in constant' error, as csc.exe in .NET 1.1 does. How often does this happen? Every time. Additional Information: If the file is saved in DOS format, this will (also) trigger a CS1012 for having too many characters on both csc and mcs. Tested with Mono compiled from SVN a couple weeks ago on Linux, and Mono 1.1.7 on Windows XP. ---- Additional Comments From atsushi@ximian.com 2005-08-23 13:14:27 MST ---- Created an attachment (id=168120) proposed fix ---- Additional Comments From miguel@ximian.com 2005-08-23 15:57:04 MST ---- this patch can go in ---- Additional Comments From atsushi@ximian.com 2005-08-23 16:11:55 MST ---- Applied as r48758. Imported an attachment (id=168120) Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>Ubuntu Hoary x86</cf_op_sys_details> Unknown operating system unknown. Setting to default OS "Other".