Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316582 - Comparing a scalar to a collection (which can never be true) should raise a warning at compile time
Summary: Comparing a scalar to a collection (which can never be true) should raise a w...
Status: CLOSED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-11 05:36 EDT by Pierre-Charles David CLA
Modified: 2011-10-12 05:22 EDT (History)
1 user (show)

See Also:


Attachments
Patch v1.0 (2.56 KB, patch)
2010-08-11 08:10 EDT, Stephane Begaudeau CLA
mariot.chauvin: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Charles David CLA 2010-06-11 05:36:35 EDT
Build Identifier: 20100603-0907

Given a : A with a multi-valued EString feature f, the test

[if (a.f = 'foo')]

can never be true as e.f is a collection and 'foo' a scalar. If it can be detected at compile-time, raising a warning would help the user to fix it. 

Ideally a quick fix would be provided to rewrite the test as

[if (a.f->includes('foo')]

Reproducible: Always
Comment 1 Stephane Begaudeau CLA 2010-08-11 08:10:19 EDT
Created attachment 176327 [details]
Patch v1.0
Comment 2 Stephane Begaudeau CLA 2010-11-02 12:50:44 EDT
Patch contributed on head and available on Acceleo 3.1.0 M4.