2005-12-21 Maverson Eduardo Schulze Rosa <maverson@gmail.com>
authorAlexandre Rocha Lima e Marcondes <alexandre@mono-cvs.ximian.com>
Wed, 28 Dec 2005 03:46:25 +0000 (03:46 -0000)
committerAlexandre Rocha Lima e Marcondes <alexandre@mono-cvs.ximian.com>
Wed, 28 Dec 2005 03:46:25 +0000 (03:46 -0000)
        * ecore.cs, cfold.cs: Changed for reflecting correct Error
Number/Message with Implict Convertions when Option Strict is On.

svn path=/trunk/mcs/; revision=54895

mcs/mbas/ChangeLog
mcs/mbas/Test/errors/ArithmeticOperatorsC3.vb
mcs/mbas/Test/tests/ChangeLog
mcs/mbas/Test/tests/test-mbas.pl
mcs/mbas/cfold.cs
mcs/mbas/ecore.cs

index bceff05007d58c56324b34c23392a87437d69d9c..67f23c98e9536cf6747caf72e71a76ebfe36c1a0 100644 (file)
@@ -1,3 +1,7 @@
+2005-12-21 Maverson Eduardo Schulze Rosa <maverson@gmail.com>
+       * ecore.cs, cfold.cs: Changed for reflecting correct Error Number/Message with
+       Implict Convertions when Option Strict is On.
+
 2005-12-07 Jelmer Vernooij <jelmer@samba.org>
        * Makefile: allow build of only mbas, without the need to built the 
        class library
index 3f3ba0a9367dd464d9b0d8d8887887d1631f196f..323b1fab074ecdd1a83c8e6200cd0ec3ef5d9648 100644 (file)
@@ -1,4 +1,4 @@
-REM LineNo: 19
+REM LineNo: 13
 REM ExpectedError: BC30512
 REM ErrorMessage: Option Strict On disallows implicit conversions from 'Double' to 'Long'.
 
@@ -16,4 +16,4 @@ Module ArithmeticOperatorsC2
         b1 = 34.45D
     End Sub
 
-End Module
\ No newline at end of file
+End Module
index bac7ded8a8d272781a14bb9022372045ffb9989a..bd047c227d48c2066c6eb5548598280600bca1ab 100644 (file)
@@ -1,3 +1,6 @@
+2005-12-28 Maverson Eduardo Schulze Rosa <maverson@gmail.com>
+       * test-mbas.pl: Corrections on the Test Files Parsing
+       
 2005-12-15 Maverson Eduardo Schulze Rosa <maverson@gmail.com>
        * test-mbas.pl: Parsing Test Files in order to find necessary
        compilerOptions and generate the correct CompileCommand.
index e682257f85d1a9e0fa64a6437751e9bfc1197caf..199434b374223813f6e2352a0383947eb6f094bd 100755 (executable)
@@ -62,10 +62,9 @@ sub ParseTestFile
 sub Command
 {
     my $retVal;
-#   my $cmdLine = shift(@_);
-    my $cmdLine  = $CompileCmd;
-#    $cmdLine =~ s/MONO_PATH="/MONO_PATH="$mbasPath\/Test\/dlls\/:/;
-
+    my $cmdLine = shift(@_);
+    $cmdLine =~ s/MONO_PATH="/MONO_PATH="$mbasPath\/Test\/dlls\/:/;
+    
     open SAVEOUT, ">&STDOUT";
     open SAVEERR, ">&STDERR";
 
index dcf917072892a00cccf4d240f90fdd6d566381b6..a8d81e57530f0c17afdd5773647c8dd92812aa02 100644 (file)
@@ -700,6 +700,13 @@ namespace Mono.MonoBASIC {
                                        return null;
 
                                try {
+                                       if (Mono.MonoBASIC.Parser.OptionStrict && (!(left is LongConstant) && !(left is IntConstant)) )
+                                       {
+                                               Expression.Error_CannotConvertTypeStrict (left.Type, Type.GetType("System.Int64"), loc);
+                                               
+                                               return null;
+                                       }
+                                       
                                        if (left is DoubleConstant) {
                                                long left_val, right_val, res;
                                                left_val = (long) ((DoubleConstant) left).Value;
index 64d2bbd1fd6ec1b347f16d2786c6e556b9a3fdd6..623e22eff518fb11fd6f465f74b73fa3353474ce 100644 (file)
@@ -2440,6 +2440,14 @@ namespace Mono.MonoBASIC {
                        // Report.Error (30512, loc, msg);
                }
 
+                static public void Error_CannotConvertTypeStrict (Type source, Type target, Location loc)
+               {
+                       Report.Error (
+                               30512, loc, "Cannot convert implicitly from '" +
+                               TypeManager.MonoBASIC_Name (source) + "' to '" +
+                               TypeManager.MonoBASIC_Name (target) + "' with Option Strict On.");
+               }               
+
                /// <summary>
                ///   Attemptes to implicityly convert 'target' into 'type', using
                ///   ConvertImplicit.  If there is no implicit conversion, then