yoday / stab-language

Automatically exported from code.google.com/p/stab-language
Apache License 2.0
0 stars 1 forks source link

Method: No return value generates an exception #44

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The following code generates an exception:

using java.lang;
using java.util;

package test {

  public class Main {

    public void testWithWarnings(){
      List resul = testWithoutWarnings();
    }

    public List<String> testWithoutWarnings(){
    }

  }
}

the exception:

Exception in thread "main" java.util.NoSuchElementException
    at stab.query.Query$EmptyIterator.next(Query.stab:1213)
    at stab.tools.compiler.BytecodeHelper.getImplicitConversion(BytecodeHelper.stab:75)
    at stab.tools.compiler.MethodResolver.makeLowerBoundInference(MethodResolver.stab:691)
    at stab.tools.compiler.MethodResolver.resolveMethod(MethodResolver.stab:139)
    at stab.tools.compiler.MethodResolver.resolveMethod(MethodResolver.stab:35)
    at stab.tools.compiler.ExpressionValidator.handleInvocation(ExpressionValidator.stab:919)
    at stab.tools.compiler.ExpressionValidator.handleInvocation(ExpressionValidator.stab)
    at stab.tools.syntaxtree.ExpressionHandler.handleExpression(ExpressionHandler.stab:58)
    at stab.tools.compiler.StatementValidator.handleLocalDeclaration(StatementValidator.stab:262)
    at stab.tools.compiler.StatementValidator.handleLocalDeclaration(StatementValidator.stab)
    at stab.tools.syntaxtree.StatementHandler.handleStatement(StatementHandler.stab:67)
    at stab.tools.compiler.StatementValidator.handleBlock(StatementValidator.stab:42)
    at stab.tools.compiler.StatementValidator.handleBlock(StatementValidator.stab)
    at stab.tools.syntaxtree.StatementHandler.handleStatement(StatementHandler.stab:31)
    at stab.tools.compiler.Compiler.validateClassMethodCode(Compiler.stab:3114)
    at stab.tools.compiler.Compiler.validateClassCode(Compiler.stab:2766)
    at stab.tools.compiler.Compiler.validateCode(Compiler.stab:2683)
    at stab.tools.compiler.Compiler.validateCode(Compiler.stab:2702)
    at stab.tools.compiler.Compiler.validateCode(Compiler.stab:2680)
    at stab.tools.compiler.Compiler.validateCode(Compiler.stab:2649)
    at stab.tools.compiler.Compiler.doCompile(Compiler.stab:328)
    at stab.tools.compiler.Compiler.compileFromFiles(Compiler.stab:222)
    at stab.tools.compiler.Application.run(Application.stab:129)
    at stab.tools.compiler.Application.main(Application.stab:31)

Original issue reported on code.google.com by ice.ta...@gmail.com on 8 Mar 2011 at 11:57