Get error when View Design a class file which contains a var

Posted by Ziping Wang on 07-Jul-2016 05:11

I add one line to my class:
DEFINE VARIABLE integerList AS "List<INTEGER>" NO-UNDO.

It compiles and check syntax ok, but when View Design, get error
"Visual Designer cannot load this class, line 24: unable to resolve type information for type List<System.Int32> for field integerList"

How to fix it?

Here is code:

BLOCK-LEVEL ON ERROR UNDO, THROW.

USING "System.Collections.Generic.List<INTEGER>" FROM ASSEMBLY.
USING Progress.Windows.Form FROM ASSEMBLY.

CLASS Test INHERITS Form:

    DEFINE PRIVATE VARIABLE components AS System.ComponentModel.IContainer NO-UNDO.
    
    DEFINE VARIABLE integerList AS "List<INTEGER>" NO-UNDO.

    CONSTRUCTOR PUBLIC Test (  ):

        SUPER().
     
        InitializeComponent().
        THIS-OBJECT:ComponentsCollection:ADD(THIS-OBJECT:components).
   
        CATCH e AS Progress.Lang.Error:
            UNDO, THROW e.
        END CATCH.

    END CONSTRUCTOR.


    METHOD PRIVATE VOID InitializeComponent(  ):

        /* NOTE: The following method is automatically generated.

        We strongly suggest that the contents of this method only be modified using the
        Visual Designer to avoid any incompatible modifications.

        Modifying the contents of this method using a code editor will invalidate any support for this file. */
        THIS-OBJECT:SuspendLayout().
        /*  */
        /* Test */
        /*  */
        THIS-OBJECT:ClientSize = NEW System.Drawing.Size(292, 266).
        THIS-OBJECT:Name = "Test":U.
        THIS-OBJECT:Text = "Test":U.
        THIS-OBJECT:ResumeLayout(FALSE).
        CATCH e AS Progress.Lang.Error:
            UNDO, THROW e.
        END CATCH.
    END METHOD.

    DESTRUCTOR PUBLIC Test ( ):

    END DESTRUCTOR.

END CLASS.

All Replies

Posted by Simon L. Prinsloo on 11-Jul-2016 00:35

That happens when the Eclipse Class cache is corrupt.

The problem is normally resolved after you clean the project (on the project menu) or start PDSOE with the -clean startup parameter.

If that does not work;

1. Close Eclipse and wait for the javaw process to go away.

2. Browse to <WORKSPACE-LOCATION>\.metadata\.plugins\com.openedge.pdt.ve

3. Delete the "types.cache"  file.

4. Restart PDSOE and recompile everything.

Posted by Lieven De Foor on 11-Jul-2016 02:33

I've copy/pasted the above code to a new file and get the same error, so I doubt it's a caching problem (since I didn't have the file to begin with...)

Posted by Mike Fechner on 11-Jul-2016 02:36

The class cache is workspace specific. Not file specific.

Posted by Ziping Wang on 11-Jul-2016 02:42

Thanks Simon! But unfortunately, i still get same error. Does the code work on your machine?

Posted by Mike Fechner on 11-Jul-2016 02:49

In addition to why Simon wrote, I do also delete all non xml files in the folder: .metadata/.plugins/com.openedge.pdt.project

There's even an ANT script for that: community.progress.com/.../11207

Posted by Mike Fechner on 11-Jul-2016 02:51

Problem with you code may be that you should define the generic type as

define variable o as "System.Collections.Generic.List<System.Int32>" no-undo .

Posted by Ziping Wang on 11-Jul-2016 03:07

Thanks Mike!

Use fully qualified type, System.Collections.Generic.List<System.Int32>

It works!

Posted by Lieven De Foor on 12-Jul-2016 04:36

Then that would be a workaround for this bug. The compiler has no problem with it, only the designer (why is the Designer looking at that code anyway, shouldn't it only care about the InitializeComponent?)

This thread is closed