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

Primitive types #4

Open
yallie opened this issue Oct 11, 2018 · 2 comments
Open

Primitive types #4

yallie opened this issue Oct 11, 2018 · 2 comments

Comments

@yallie
Copy link
Member

yallie commented Oct 11, 2018

Looks like we can't use .NET primitive types because of the missing APIs.
Examples:

  • string.replace(text1, text2) → string.Replace(text1, text2)
  • int.valueOf("123") → int.Parse("123")
  • etc.

I suggest that we emit String, Integer and so on — the mockable types defined in Apex.dll.

@yallie
Copy link
Member Author

yallie commented Oct 17, 2018

There's a big gotcha: we'll need to implement all these Apex classes to use them,
while .NET primitives are already available out of the box, albeit with their own APIs.

yallie added a commit to yallie/ApexParser that referenced this issue Oct 27, 2018
@yallie
Copy link
Member Author

yallie commented Oct 28, 2018

Current approach:

  • Static methods are not translated: Integer.valueOf(x) remains the same
  • Instance methods are implemented as extension methods in Apex.ApexSharp.Extensions

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