Bug 389147 - [xbase][lib] Add overloaded variants of InputOutput.print and println
Summary: [xbase][lib] Add overloaded variants of InputOutput.print and println
Status: REOPENED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.4.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2012-09-10 05:37 EDT by Sebastian Zarnekow CLA
Modified: 2016-09-14 13:15 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Zarnekow CLA 2012-09-10 05:37:23 EDT
Consider the following use case

myMethod(Object o) { }
myMethod(int i) { }


doStuff() {
  var i = 1

  return myMethod(i) vs return myMethod(println(i))
}

Since println currently returns an object, adding logging to the return expression will change the semantics of the method. Therefore I suggest to add overloaded variants for print and println similar to java.io.PrintWriter but with a return value
Comment 1 Eclipse Genie CLA 2016-08-17 08:53:08 EDT
GitHub Pull Request 5 created by [cdietrich]
https://github.com/eclipse/xtext-lib/pull/5
Comment 2 Christian Dietrich CLA 2016-09-14 05:14:28 EDT
fixed in Xtext 2.11
Comment 3 Christian Dietrich CLA 2016-09-14 13:14:50 EDT
reverted change caused by negative side effects on the type inference