Explorar o código

Bug-fix update

Fixing reported bugs in beta of 1.4.08 for NET
John Gough %!s(int64=6) %!d(string=hai) anos
pai
achega
e80202a69c
Modificáronse 5 ficheiros con 21 adicións e 6 borrados
  1. 3 1
      gpcp/CPascalErrors.cp
  2. 1 1
      gpcp/ClsToType.cp
  3. 1 1
      gpcp/GPCPcopyright.cp
  4. 1 1
      gpcp/MakeIndex/MakeIndex.cp
  5. 15 2
      gpcp/TypeDesc.cp

+ 3 - 1
gpcp/CPascalErrors.cp

@@ -419,7 +419,7 @@ MODULE CPascalErrors;
     | 152: str := "Bound type of foreign reference type cannot be assigned";
     | 153: str := "Bound type of foreign reference type cannot be value param";
     | 154: str := "It is not possible to extend an interface type";
-    | 155: str := "NEW illegal unless foreign supertype has no-arg constructor";
+    | 155: str := "NEW is illegal because foreign basetype has no no-arg constructor";
     | 156: str := "Interfaces can only extend ANYREC or the target Object type";
     | 157: str := "Only extensions of Foreign classes can implement interfaces";
     | 158: str := "Additional base types must be interface types";
@@ -513,6 +513,8 @@ MODULE CPascalErrors;
     | 238: str := "STA is illegal unless target is NET";
     | 239: str := "This module can only be accessed via an alias";
     | 240: str := "This module already has an alias";
+	| 241: str := "Variable has a foreign type without a no-arg constructor";
+
 
     | 298: str := "ILASM failed to assemble IL file";
     | 299: str := "Compiler raised an internal exception";

+ 1 - 1
gpcp/ClsToType.cp

@@ -423,7 +423,7 @@ MODULE ClsToType;
     ELSIF name = "SByte"   THEN RETURN Bi.byteTp;
     ELSIF name = "UInt8"   THEN RETURN Bi.uBytTp;
     ELSIF name = "Byte"   THEN RETURN Bi.uBytTp;
-    ELSIF name = "Single"  THEN RETURN Bi.intTp;
+    ELSIF name = "Single"  THEN RETURN Bi.sReaTp;
     ELSIF name = "Double"  THEN RETURN Bi.realTp;
     ELSIF name = "Boolean" THEN RETURN Bi.boolTp;
 

+ 1 - 1
gpcp/GPCPcopyright.cp

@@ -57,7 +57,7 @@ MODULE GPCPcopyright;
      (* VERSION    = "1.4.05 of 11 October 2017"; *)
      (* VERSION    = "1.4.06 of 18 February 2018"; *)
      (* VERSION    = "1.4.07 of 04 March 2018"; *)
-        VERSION    = "1.4.08 of 10 April 2019"; 
+        VERSION    = "1.4.08b of 1 May 2019"; 
 	verStr*    = " version " + VERSION;
 
   CONST	prefix     = "#gpcp: ";

+ 1 - 1
gpcp/MakeIndex/MakeIndex.cp

@@ -69,7 +69,7 @@ BEGIN (* Static code of Module *)
   NEW(appState);
   IF ProgArgs.ArgNumber() = 0 THEN
     Console.WriteString("Usage: MakeIndex [-verb] -dst:dir"); Console.WriteLn;
-    Console.WriteString("     -dst:dir    - find symfiles in directory 'dir'"); Console.WriteLn;
+    Console.WriteString("     -dst:dir    - find Browse Files in directory 'dir'"); Console.WriteLn;
     Console.WriteString("     -verb[ose]  - emit progress information."); Console.WriteLn;
     Console.WriteString("Output file is 'dir\index.html'"); Console.WriteLn;
     HALT(0);

+ 15 - 2
gpcp/TypeDesc.cp

@@ -874,7 +874,11 @@ MODULE TypeDesc;
     ELSIF (i.recAtt = limit) & i.isImportedType() THEN
       S.SemError.Report(71, tok.lin, tok.col);
     ELSIF (Sy.clsTp IN i.xAttr) & (Sy.noNew IN i.xAttr) THEN
-      S.SemError.Report(155, tok.lin, tok.col);
+	  IF i.isExtnRecType() THEN 
+        S.SemError.Report(241, tok.lin, tok.col);
+	  ELSE
+        S.SemError.Report(155, tok.lin, tok.col);
+	  END;
     END;
   END InstantiateCheck;
 
@@ -1734,7 +1738,16 @@ MODULE TypeDesc;
             i.TypeError(102); (* abstract record must have abstract base *)
           ELSIF baseT.isExtnRecType() THEN
             i.CopyFieldsOf(baseT);
-            IF Sy.noNew IN baseT.xAttr THEN INCL(i.xAttr, Sy.noNew) END;
+		   (*
+		    * There is a subtlety here: if i is a CP type and baseT is an 
+			* external record type with no no-arg constructor then i must 
+			* have the noNew attribute. However this does not apply if i 
+			* is also an external type, since the i might have a ctor 
+			* that performs a base call to a with-args ctor of baseT.
+			*)
+            IF (Sy.noNew IN baseT.xAttr) & ~i.isExtnRecType() THEN 
+			  INCL(i.xAttr, Sy.noNew) 
+			END;
 (* ----- Code for extensible limited records ----- *)
           ELSIF baseT.isLimRecType() THEN
             IF ~i.isLimRecType() THEN