Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345371 - Xtend2 generates a void _xblockexpression
Summary: Xtend2 generates a void _xblockexpression
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: RC1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 345458 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-05-11 04:03 EDT by Serano Colameo CLA
Modified: 2017-09-19 18:05 EDT (History)
2 users (show)

See Also:
sven.efftinge: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Serano Colameo CLA 2011-05-11 04:03:19 EDT
Build Identifier: 2.0.0.v201105101404

  public String toIdlFileName(final InterfaceDcl iface) { 
    try { 
      void _xblockexpression = null; // wrong block definition
      { 
....


Reproducible: Always

Steps to Reproduce:
1. create an Xtend2 class
2. put this code snippet:
    def String toIdlFileName(InterfaceDcl iface) { 
                try { 
                        val fileName = new File(iface.eResource.URI.toFileString).name 
                        if (fileName.contains('.')) return fileName.split('\\.').get(0) 
                        return fileName 
                } catch (Exception ex) { 
                        return iface.name; 
                } 
        }
Comment 1 Serano Colameo CLA 2011-05-11 04:18:51 EDT
workaround: remove "return" keyword and xtend generates correct statements
Comment 2 Sven Efftinge CLA 2011-05-12 03:51:01 EDT
*** Bug 345458 has been marked as a duplicate of this bug. ***
Comment 3 Sven Efftinge CLA 2011-05-16 04:14:26 EDT
turned out to be a general problem with branching expressions (if, switch, try-catch) in cases where branches were mixing early exits (return, throw) and simple expressions.
Fixed and pushed to master.
Comment 4 Karsten Thoms CLA 2017-09-19 17:54:20 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 18:05:05 EDT
Closing all bugs that were set to RESOLVED before Neon.0