vala-language-server icon indicating copy to clipboard operation
vala-language-server copied to clipboard

conversion to untyped generic-error not displayed

Open gavr123456789 opened this issue 5 years ago • 1 comments

Describe the bug The generic convert error is not displayed.

Software OS and version (e.g. Ubuntu 20.04): VSCode Vala Language Server (e.g. git commit, or PPA/AUR version): workflow-improvements branch Vala version (valac --version): 0.48.4

To Reproduce

void add_to_list_map<K, VV> (ref Gee.HashMap<K, Gee.ArrayList<VV>> map, K key, VV val){
    if (!map.has_key(key)) {
        var empty_collection = Collection.empty<VV>();
        empty_collection.add(val);
        map[key] = empty_collection as ArrayList; // here must be error
    }
    else{
        map[key].add(val);
    }
}
 error: Argument 2: Cannot convert from `unowned Gee.ArrayList?' to `unowned Gee.ArrayList<VV>'
        map[key] = empty_collection as ArrayList;
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../vvvv.vala:5.5-5.53: warning: unhandled error `GLib.FileError'
    FileUtils.get_contents("test.", out text_content);
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Compilation failed: 1 error(s), 1 warning(s)

gavr123456789 avatar Apr 28 '20 06:04 gavr123456789

Without looking into this further yet, I'll say that currently there are a fair number of errors that the Vala compiler only shows when you run the code generator, so this may be an upstream problem.

Prince781 avatar Apr 28 '20 11:04 Prince781