Bug 318249 (MONO75245) - [PATCH] Newline in character literal should trigger CS1010 error
Summary: [PATCH] Newline in character literal should trigger CS1010 error
Status: RESOLVED FIXED
Alias: MONO75245
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Enhancement
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-13 09:05 UTC by Brion Vibber
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
proposed fix (474 bytes, patch)
2005-08-23 20:14 UTC, Thomas Wiest
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:21:02 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".