Skip to content

Conversation

@Kamirus
Copy link
Contributor

@Kamirus Kamirus commented Oct 14, 2025

Add partial explicit type instantiation using wildcard for types that must be inferred.
Example:

VarArray.map<_, Nat>(testArray, func x = x * 2)
  1. Specifies the 2nd type argument in order to avoid the invariance limitation (Otherwise could be ambiguous: Nat vs Int)
  2. Omit the 1st type argument, let the compiler infer it

Partial type instantiations are an improvement over explicit return type annotations:

  • Works well with the dot-notation (return type annotations needed extra parenthesis or intermediate let-binding)
  • Shorter, more concise syntax

@github-actions
Copy link
Contributor

github-actions bot commented Oct 14, 2025

Comparing from aa67d28 to f8ea484:
In terms of gas, no changes are observed in 5 tests.
In terms of size, no changes are observed in 5 tests.

@Kamirus Kamirus marked this pull request as ready for review October 17, 2025 14:33
@Kamirus Kamirus requested a review from a team as a code owner October 17, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant