This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 256759 - @property ignores all but the last type when multiple types are declared with pipe (|) during auto-complete
Summary: @property ignores all but the last type when multiple types are declared with...
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: junichi11
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-24 11:17 UTC by parkanyi
Modified: 2017-05-26 01:52 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description parkanyi 2015-11-24 11:17:02 UTC
Multiple types separated by pipe (|) at @property are not working during auto-complete, only the last member is evaluated by NetBeans. This breaks e.g. Yii2 compatibility, which uses this feature extensively. In contrast, @var works with multiple types.

Test code:

<?php

/**
 * @property T1|T2|T3 $p
 */
class Test
{
    /**
     * @var T1|T2|T3
     */
    public $v;
}

class T1
{
    public $t1;
}

class T2
{
    public $t2;
}

class T3
{
    public $t3;
}

$test = new Test();

// @var
$test->v->[CTRL+SPACE] // shows t1, t2, t3

// @property
$test->p->[CTRL+SPACE] // shows only t3

?>
Comment 1 Tomas Mysik 2016-06-03 06:01:45 UTC
Thanks for catching that.
Comment 2 junichi11 2017-05-25 01:18:54 UTC
Fixed.

http://hg.netbeans.org/web-main/rev/1169b2230913

Thanks.
Comment 3 Quality Engineering 2017-05-26 01:52:18 UTC
Integrated into 'main-silver', will be available in build *201705260001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/1169b2230913
User: Junichi Yamamoto <junichi11@netbeans.org>
Log: #256759 - @property ignores all but the last type when multiple types are declared with pipe (|) during auto-complete