Skip to content

[display] @position on assignment pattern declaration #6395

@Gama11

Description

@Gama11
import haxe.ds.Option;

class Main {
	public static function main() {
		switch (Some(Some("foo"))) {
			case Some(inner = Some(_)):
				inner;
			case _:
		}
	}
}

I originally thought this was the same as #6381, I guess not though. Requesting @position on the usage in line 7 works:

> haxe --display Main.hx@143@position
<list>
<pos>...\source\Main.hx:6: characters 14-19</pos>
</list>

If you instead do it on the "declaration" the line before, you just get an empty list:

> haxe --display Main.hx@120@position
<list>
</list>

Of course it's a bit silly to request the position of the declaration when you're already there, but vshaxe's rename relies on this, plus it seems to work everywhere else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions