ballerina-lang icon indicating copy to clipboard operation
ballerina-lang copied to clipboard

Error in `from` inside a `from`

Open manuranga opened this issue 4 years ago • 0 comments

error? e = from var dir in check file:readDir("./testSuite")
           where check file:test(dir.absPath, file:IS_DIR)
           from var sub in check file:readDir(dir.absPath)
           do {
               io:println(sub.absPath);
           };

Above code gives following runtime error:

error: {ballerina/lang.array}InherentTypeViolation {"message":"incompatible types: expected 'file:MetaData', found 'file:(ballerina/file:0.7.0-beta.2:MetaData & readonly)'"}
        at ballerina.lang.map.1_1_0:entries(map.bal:74)
           ballerina.lang.query.0_0_1._NestedFromFunction:process(types.bal:244)
           ballerina.lang.query.0_0_1._InputFunction:process(types.bal:190)
           ballerina.lang.query.0_0_1._DoFunction:process(types.bal:621)
           ballerina.lang.query.0_0_1:$annon$method$delegate$0(types.bal:91)
           ballerina.lang.__internal.0_1_0:invokeAsExternal(stream-utils.bal:138)
           ballerina.lang.query.0_0_1._StreamPipeline:next(types.bal:91)
           ballerina.lang.query.0_0_1.IterHelper:next(types.bal:723)
           ballerina.lang.stream.0_4_0:next(stream.bal:67)
           ballerina.lang.query.0_0_1:consumeStream(helpers.bal:151)
           manu.double_dir_iter.0_1_0:main(main.bal:7)

manuranga avatar Sep 08 '21 05:09 manuranga