Skip to content

[display] display/typeDefinition doesn't work in object literal #7802

Description

@Gama11
class Main {
	static function main() {
		var foo:Foo = { | bar: 0};
	}
}

typedef Foo = {bar:Int};

Invoking "go to type definition" at the | doesn't take you to Foo.

This may look a bit silly in the above example, but this can be especially useful in cases where there isn't a type hint nearby to use the regular "go to definition" on:

class Main {
	static function main() {
		var e:haxe.macro.Expr.ExprDef = null;
		switch (e) {
			case EObjectDecl(fields):
				fields.push({ |
					field: "foo",
					expr: macro "bar"
				})
			case _:
		}
	}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions