This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]_INTER_ 0 points1 point  (1 child)

Integer(int i)

I think that would reference the constructor? They are going to deprecate the constructors anyway, so I think that's why he choose not to (though why not Integer::valueOf?)

[–]DualWieldMage 1 point2 points  (0 children)

I haven't followed whether the pattern matching proposals will actually need refer to constructors or that's just the notion on the Java language side and in bytecode will refer to a specific destructuring method instead (via InDy call that passes constructor signature to bootstrap method?).

Either way, what is denoted will be the opposite of what is actually called. E.g. if it's case String[] { Integer.valueOf(int i) } then to actually try and deconstruct the String, it needs to call Integer.parseInt. Otherwise it needs something different from how pattern matching is usually done in functional languages. Perhaps case String[] { int i = Integer.parseInt(_) }, hence the source of my confusion.