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

Use val instead of def when there are no arguments in the generated Scala code #141

Closed
AttilaMihaly opened this issue Sep 1, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@AttilaMihaly
Copy link
Member

This code:

  def basicLetDefinition: morphir.sdk.Basics.Int = {
    def a: morphir.sdk.Basics.Int =
      morphir.sdk.Basics.Int(1)
    
    def b: morphir.sdk.Basics.Int =
      a
    
    def d(
      i: morphir.sdk.Basics.Int
    ): morphir.sdk.Basics.Int =
      i
    
    d(b)
  }  

Should turn into this:

  def basicLetDefinition: morphir.sdk.Basics.Int = {
    val a: morphir.sdk.Basics.Int =
      morphir.sdk.Basics.Int(1)
    
    val b: morphir.sdk.Basics.Int =
      a
    
    def d(
      i: morphir.sdk.Basics.Int
    ): morphir.sdk.Basics.Int =
      i
    
    d(b)
  }  
@AttilaMihaly AttilaMihaly self-assigned this Sep 1, 2020
@AttilaMihaly AttilaMihaly added the enhancement New feature or request label Sep 1, 2020
AttilaMihaly added a commit to AttilaMihaly/morphir-elm that referenced this issue Sep 1, 2020
AttilaMihaly added a commit that referenced this issue Sep 1, 2020
* Fix elm-syntax version in CLI.

* Fix elm-syntax operator precedence.

* Use better literal wrappers in generated Scala.

* Generate case objects for no-argument type constructors. #105

* Flatten nested let expressions. #140

* Use val instead of def when there are no arguments. #141
AttilaMihaly added a commit to AttilaMihaly/morphir-elm that referenced this issue Sep 1, 2020
AttilaMihaly added a commit that referenced this issue Sep 1, 2020
* Fix elm-syntax version in CLI.

* Fix elm-syntax operator precedence.

* Use better literal wrappers in generated Scala.

* Generate case objects for no-argument type constructors. #105

* Flatten nested let expressions. #140

* Use val instead of def when there are no arguments. #141

* Cosmetic improvement.

* Add type information to vals. #141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant