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.
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.
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...)
The class cache is workspace specific. Not file specific.
Thanks Simon! But unfortunately, i still get same error. Does the code work on your machine?
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
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 .
Thanks Mike!
Use fully qualified type, System.Collections.Generic.List<System.Int32>
It works!
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?)