After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 589236 - One can't use & (address-of) on a generic type parameter
One can't use & (address-of) on a generic type parameter
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Semantic Analyzer
unspecified
Other All
: Normal normal
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-21 10:55 UTC by Didier "Ptitjes"
Modified: 2009-07-21 12:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Didier "Ptitjes" 2009-07-21 10:55:39 UTC
When provided the following code:

public class Test<V> {
    public void dumb_method(V in_value, out V? out_value) {
        if (&out_value != null) {
            out_value = in_value;
        }
    }
}

valac reports:

error: Address-of operator not supported for this expression

This works for any other variable type.
Comment 2 Jürg Billeter 2009-07-21 12:24:11 UTC
commit 60ac7e30c7fa108537eeae51a1bb8a144c80f176
Author: Didier 'Ptitjes <ptitjes@free.fr>
Date:   Tue Jul 21 10:11:57 2009 +0200

    Support taking address of generic variables
    
    Fixes bug 589236.
    
    Signed-off-by: Didier 'Ptitjes <ptitjes@free.fr>