Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350979 - Unhelpful editor diagnostics
Summary: Unhelpful editor diagnostics
Status: CLOSED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: 3.0.0   Edit
Hardware: PC Windows Vista
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-02 01:23 EDT by Ed Willink CLA
Modified: 2016-04-13 08:19 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2011-07-02 01:23:24 EDT
3.1.0 The following queries for a model containing

Class.name : String
Class.superClass : Set(Class)

[The apparently strange extra Set(...) is becuase there are multiple parallel trees so Class X may have superclasses in more than one tree]

-----

[query public cgGetAllSuperClasses(elem : Set(Class)) : Set(Set(Class)) = 
let superClasses : Set(Class) = cgGetAllSuperClasses1(elem)
in let superClassNames : Set(String) = superClasses->collect(name)->asSet()
in superClassNames->iterate(superClassName : String; acc : Set(Set(Class)) = Set{}
| acc->union(superClasses->collect(name = superClassName)->asSet())) /]

[query public cgGetAllSuperClasses1(elem : Set(Class)) : Set(Class) = 
elem->closure(superClass)->union(elem) /]

----

demonstrates 5 problems

a) closure must be factored out to avoid a spurious "usage of non-standard closure" message that suppresses all other diagnostics and only vanishes when no other messages are present.

b) gives a duplicate message in the error hovertext

Iterate expression body type must conform to the result type (superClassNames->iterate(superClassName : String; acc : Set(Set(Class)) = Set {} | acc->union(superClasses->collect(temp2 : Class | temp2.name.=(superClassName))->asSet()))) Iterate expression body type must conform to the result type (superClassNames->iterate(superClassName : String; acc : Set(Set(Class)) = Set {} | acc->union(superClasses->collect(temp2 : Class | temp2.name.=(superClassName))->asSet())))

c) Gives me no help by failing to tell me

Iterate expression body type
result type

d) gives me no partial expression hover text to support viewing individual terms

e) after editing the query, the error does not update until a Ctrl-S and a very slow workspace rebuild completes.
Comment 1 Ed Willink CLA 2011-07-02 01:28:10 EDT
It's not just unhelpful, the diagnostic is actually wrong; after refactoring the iterate body to a separate query, it compiles.
Comment 2 Laurent Goubet CLA 2016-04-04 04:50:00 EDT
This same query now gives a single error message 

"Iterate expression body type must conform to the result type"

So a) and b) are solved.

c) cannot be addressed since it comes from an OCL's SemanticException which sole message is what we print, no info on result type or iterate body type. See Bug #490990

I don't understand d)

e) is not reproducible.

Leaving open for now in case you remember what you meant with d).
Comment 3 Laurent Goubet CLA 2016-04-13 08:19:29 EDT
Closing for now as what could be fixed has been. Please reopen if you remember what the last part meant