[Swift-devel] unitialized error when swift app returning a non-file type

Mihael Hategan hategan at mcs.anl.gov
Mon Apr 1 16:10:39 CDT 2013


Wait, it's no bug.

It's a poor error message. This refers to the 'b' that is a return
parameter in s_app. You are using it as an input parameter on the
command line.

Mihael

On Mon, 2013-04-01 at 14:03 -0700, Mihael Hategan wrote:
> It's a bug. Working on it.
> 
> On Mon, 2013-04-01 at 15:50 -0500, Ketan Maheshwari wrote:
> > Hi,
> > 
> > Wondering if this is an expected behavior. I intend a Swift app to return a
> > variable which I then receive in a Swift variable. This variable is
> > uninitialized since initializing it would close it out.
> > 
> > Here is a minuscule example:
> > 
> > app (string b) s_app(string a){
> >  str_app a b;
> > }
> > 
> > string[] b;
> > 
> > foreach i in [0:10]{
> >    b[i]= s_app("hello");
> > }
> > 
> > The s_app links to a bash script as follows:
> > 
> > #!/bin/bash
> > 
> > $2=$1
> > 
> > On running this:
> > 
> > $ swift str.swift -tc.file tc -sites.file sites.xml
> > Could not start execution
> > Uninitalized variable: b
> > 
> > 
> > The detailed exception from the log is:
> > 2013-04-01 15:47:33,755-0500 DEBUG Loader Detailed exception:
> > org.griphyn.vdl.karajan.CompilationException: Uninitalized variable: b
> >     at
> > org.griphyn.vdl.engine.VariableScope.undeclare(VariableScope.java:1143)
> >     at
> > org.griphyn.vdl.engine.VariableScope.analyzeWriters(VariableScope.java:1119)
> >     at
> > org.griphyn.vdl.engine.VariableScope.analyzeWriters(VariableScope.java:1115)
> >     at
> > org.griphyn.vdl.engine.VariableScope.analyzeWriters(VariableScope.java:1115)
> >     at
> > org.griphyn.vdl.engine.VariableScope.analyzeWriters(VariableScope.java:1085)
> >     at org.griphyn.vdl.engine.Karajan.program(Karajan.java:316)
> >     at org.griphyn.vdl.engine.Karajan.compile(Karajan.java:137)
> >     at org.griphyn.vdl.karajan.Loader.compile(Loader.java:351)
> >     at org.griphyn.vdl.karajan.Loader.main(Loader.java:172)
> > 
> > Thanks for any help.
> > 
> > Hi,
> > 
> > 
> > Wondering if this is an expected behavior. I intend a Swift app to
> > return a variable which I then receive in a Swift variable. This
> > variable is uninitialized since initializing it would close it out. 
> > 
> > 
> > Here is a minuscule example:
> > 
> > 
> > app (string b) s_app(string a){
> >  str_app a b;
> > }
> > 
> > 
> > string[] b;
> > 
> > 
> > foreach i in [0:10]{
> >    b[i]= s_app("hello");
> > }
> > 
> > 
> > The s_app links to a bash script as follows:
> > 
> > 
> > #!/bin/bash
> > 
> > 
> > $2=$1
> > 
> > 
> > On running this:
> > 
> > 
> > $ swift str.swift -tc.file tc -sites.file sites.xml
> > Could not start execution
> > Uninitalized variable: b
> > 
> > 
> > 
> > 
> > The detailed exception from the log is:
> > 2013-04-01 15:47:33,755-0500 DEBUG Loader Detailed exception:
> > org.griphyn.vdl.karajan.CompilationException: Uninitalized variable: b
> >     at
> > org.griphyn.vdl.engine.VariableScope.undeclare(VariableScope.java:1143)
> >     at
> > org.griphyn.vdl.engine.VariableScope.analyzeWriters(VariableScope.java:1119)
> >     at
> > org.griphyn.vdl.engine.VariableScope.analyzeWriters(VariableScope.java:1115)
> >     at
> > org.griphyn.vdl.engine.VariableScope.analyzeWriters(VariableScope.java:1115)
> >     at
> > org.griphyn.vdl.engine.VariableScope.analyzeWriters(VariableScope.java:1085)
> >     at org.griphyn.vdl.engine.Karajan.program(Karajan.java:316)
> >     at org.griphyn.vdl.engine.Karajan.compile(Karajan.java:137)
> >     at org.griphyn.vdl.karajan.Loader.compile(Loader.java:351)
> >     at org.griphyn.vdl.karajan.Loader.main(Loader.java:172)
> > 
> > 
> > Thanks for any help.
> > 
> > 
> > -- 
> > Ketan
> > 
> > 
> > _______________________________________________
> > Swift-devel mailing list
> > Swift-devel at ci.uchicago.edu
> > https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
> 
> 
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel





More information about the Swift-devel mailing list