Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316582

Summary: Comparing a scalar to a collection (which can never be true) should raise a warning at compile time
Product: [Modeling] Acceleo Reporter: Pierre-Charles David <pierre-charles.david>
Component: CoreAssignee: Project Inbox <acceleo-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: stephane.begaudeau
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Patch v1.0 mariot.chauvin: iplog+

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.