imagej / imagej/imagej2

Returning a string from a function call requires converting to string

Open
#171 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.4k
Forks
350
PR merge metrics
No merged PRs in 30d

Description

Given the following ImageJ macro:

```
function pickFile(){
return File.openDialog("Pick a file");
}

function notBuggy(){
return toString(pickFile());
}

function buggy(){
return pickFile();
}

pickFile();
notBuggy();
buggy();
```

This will ask you to pick 3 files. The first 2 times work, but the 3rd one fails with:

```
Numeric return value expected in line 11.
return pickFile( <)> ;
```

FIJI on ImageJ 1.51p, Java 1.8.0, MacOS 10.12.5

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the macro from the issue in Fiji/ImageJ, focusing on the pickFile, notBuggy, and buggy function calls. Trace the macro interpreter's handling of function return values and compare the direct return with the toString-wrapped return. Done means buggy() returns the selected path without the numeric return value error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.