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

Bug 350934

Summary: [Xbase/Xtend] Illegal code generated/missing validations for ComparableExtensions grreater/lesser than operators
Product: [Modeling] TMF Reporter: Stephane Barbey <stephane>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow
Version: unspecifiedFlags: sebastian.zarnekow: indigo+
Target Milestone: SR1   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

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