compiler/libec; ecere:SecSince1970: (#1072) Generating an error rather than invalid...
authorJerome St-Louis <jerome@ecere.com>
Tue, 1 Apr 2014 20:45:21 +0000 (16:45 -0400)
committerJerome St-Louis <jerome@ecere.com>
Tue, 1 Apr 2014 20:45:21 +0000 (16:45 -0400)
compiler/bootstrap/libec/bootstrap/pass0.c
compiler/libec/src/ast.ec
compiler/libec/src/pass0.ec
ecere/src/sys/Time.ec

index c565718..caa4ccb 100644 (file)
@@ -2240,13 +2240,12 @@ MangleClassName(name);
 params = MkList();
 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
-if(!propertyDef->symbol->_property || !propertyDef->symbol->_property->conversion)
+if((regClass->type == 1 || regClass->type == 6) || ((regClass->type == 5 || regClass->type == 0) && (!propertyDef->symbol->_property || !propertyDef->symbol->_property->conversion)))
 ListAdd(specifiers, MkSpecifier(VOID));
 else
 {
-if(regClass->type == 1)
-ListAdd(specifiers, MkSpecifier(VOID));
-else
+if(regClass->type != 5 && regClass->type != 0)
+Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "set defined on type without storage for non-conversion property\n", (((void *)0))));
 ListAdd(specifiers, MkSpecifierName(regClass->fullName));
 }
 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
index e2694fc..f324940 100644 (file)
@@ -1147,7 +1147,7 @@ FunctionDefinition _MkFunction(OldList specifiers, Declarator declarator, OldLis
                   Specifier spec = tn.qualifiers ? tn.qualifiers->first : null;
                   if(!tn.declarator && !tn.prev && !tn.next && spec && !spec.next && spec.type == baseSpecifier && spec.specifier == VOID);
                   else
-                     Compiler_Error("parameter name omitted\n");
+                     Compiler_Error($"parameter name omitted\n");
                   break;
                }
             }
index 5ecc287..212a228 100644 (file)
@@ -1200,15 +1200,14 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                         MkDeclaratorIdentifier(MkIdentifier(name)), params);
 
                      // TESTING COMMENTING OUT THESE, ADDED noHeadClass here
-                     if(!propertyDef.symbol._property || !propertyDef.symbol._property.conversion)
+                     if((regClass.type == structClass || regClass.type == unionClass) ||
+                        ((regClass.type == noHeadClass || regClass.type == normalClass) && (!propertyDef.symbol._property || !propertyDef.symbol._property.conversion)))
                         ListAdd(specifiers, MkSpecifier(VOID));
                      else
                      {
-                        // Conversion property
-                        if(regClass.type == structClass)
-                           ListAdd(specifiers, MkSpecifier(VOID));
-                        else
-                           ListAdd(specifiers, MkSpecifierName(regClass.fullName));
+                        if(regClass.type != noHeadClass && regClass.type != normalClass)
+                           Compiler_Error($"set defined on type without storage for non-conversion property\n");
+                        ListAdd(specifiers, MkSpecifierName(regClass.fullName));
                      }
 
                      func = MkClassFunction(specifiers, null, decl, null);
index fb77c77..9c548d3 100644 (file)
@@ -316,8 +316,6 @@ public class SecSince1970 : int64
 public:
    property SecSince1970 global
    {
-      // TOFIX: 'return' with a value, in function returning void
-      set { return value.local; }
       get
       {
       #if defined(__WIN32__)
@@ -371,8 +369,6 @@ public:
    };
    property SecSince1970 local
    {
-      // TOFIX: warning: 'return' with a value, in function returning void
-      set { return value.global; }
       get
       {
 #if defined(__WIN32__)