Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type parameter inference #271

Open
ReedOei opened this issue Jul 31, 2019 · 0 comments
Open

Add type parameter inference #271

ReedOei opened this issue Jul 31, 2019 · 0 comments

Comments

@ReedOei
Copy link
Collaborator

ReedOei commented Jul 31, 2019

Currently, the user must write all type parameters explicitly, for both constructor calls and transaction calls. However, as in Java, this could usually be inferred:

contract A {}
contract B[X@s] { }
main contract Main {
    transaction test() {
        // This should be equivalent to the below code:
        B[A] b = new B[A](new A());
        B[A] b2 = new B[](new A()); // Java diamond-operator-style
        // or
        B[A] b2 = new B(new A()); // Scala-style
    }
}
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

No branches or pull requests

1 participant