Skip to content

field visibility detection when parsing can be tricked #20

Open
@wolfsage

Description

@wolfsage
#!./perl -Ilib

use v5.36;

use Devel::Peek;
use Data::Dumper;

use feature 'class', 'defer';
no warnings 'experimental::class';

use experimental qw(refaliasing);

class what {
  method foo {
    class hah {
      field $x;
      sub oh { $x }
    }
  }
}

Output:

Variable "$x" will not stay shared at ./bad.pl line 17

I expect to see something like:

Field $x is not accessible outside a method at ./hmit line 17.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions