Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350934 - [Xbase/Xtend] Illegal code generated/missing validations for ComparableExtensions grreater/lesser than operators
Summary: [Xbase/Xtend] Illegal code generated/missing validations for ComparableExtens...
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: SR1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-01 09:04 EDT by Stephane Barbey CLA
Modified: 2017-09-19 17:10 EDT (History)
1 user (show)

See Also:
sebastian.zarnekow: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephane Barbey CLA 2011-07-01 09:04:50 EDT
Build Identifier: I20110613-1736

The following code:

package gub

class Buggy {
	
	def buggy() {
		if ("3">3) if ("true"<false) return true>=0;
	}
	
}

should be illegal (?). It however generates non-compilable code:

package gub;

import org.eclipse.xtext.xbase.lib.ComparableExtensions;

@SuppressWarnings("all")
public class Buggy {
  
  public Boolean buggy() {
    Object _xifexpression = null;
    boolean _operator_greaterThan = ComparableExtensions.<Integer>operator_greaterThan("3", ((Integer)3));
    if (_operator_greaterThan) {
      Object _xifexpression_1 = null;
      boolean _operator_lessThan = ComparableExtensions.<Boolean>operator_lessThan("true", ((Boolean)false));
      if (_operator_lessThan) {
        boolean _operator_greaterEqualsThan = ComparableExtensions.<Integer>operator_greaterEqualsThan(((Boolean)true), ((Integer)0));
        return _operator_greaterEqualsThan;
      }
      _xifexpression = _xifexpression_1;
    }
    return _xifexpression;
  }
}

Reproducible: Always
Comment 1 Sebastian Zarnekow CLA 2011-07-13 09:21:57 EDT
Pushed to master.
Comment 2 Karsten Thoms CLA 2017-09-19 16:59:18 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:10:49 EDT
Closing all bugs that were set to RESOLVED before Neon.0