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

Scala: mark an object that extends another type as recursive (Cherry pick of #15865) #15891

Merged
merged 1 commit into from
Jun 22, 2022

Conversation

tdyas
Copy link
Contributor

@tdyas tdyas commented Jun 22, 2022

Scala Parser cannot figure out the provided types of an object that extends another type. This PR solves this by marking the object as recursive.

The following example won't compile with Pants at the moment:

File A:

object A {
  def a(x: Int): Int = ???
}

File B:

import A

object B extends A {
  
}

File Main:

import B.a

def main() = println(a(5))

Rust tests and lints will be skipped. Delete if not intended.

[ci skip-rust]

…ild#15865)

Scala Parser cannot figure out the provided types of an object that extends another type. This PR solves this by marking the object as recursive.

The following example won't compile with Pants at the moment:

File A:
```
object A {
  def a(x: Int): Int = ???
}
```

File B:
```
import A

object B extends A {
  
}
```
File Main:
```
import B.a

def main() = println(a(5))
```
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]
@tdyas tdyas requested review from stuhood and Eric-Arellano June 22, 2022 01:47
@tdyas
Copy link
Contributor Author

tdyas commented Jun 22, 2022

cc @somdoron

@tdyas tdyas added the category:bugfix Bug fixes for released features label Jun 22, 2022
@tdyas tdyas merged commit 64d5f7f into pantsbuild:2.13.x Jun 22, 2022
@tdyas tdyas deleted the cp_scala_parser_object_recursive branch June 22, 2022 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants