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

Extension methods can be exported by name #10274

Merged
merged 37 commits into from
Jun 25, 2024

Conversation

Akirathan
Copy link
Member

@Akirathan Akirathan commented Jun 13, 2024

First part of #10258 - extension methods can be exported by name

Pull Request Description

Ultimately, we want to forbid the from ... export all syntax. This PR starts by providing a way to explicitly export extension and conversion methods by name.

Stdlib code will be modified in upcoming PR.

Important Notes

A single name can refer to multiple extension or conversion methods. Exports are not qualified. For example,

type My_Type
type Other_Type
My_Type.ext_method x = x
Other_Type.ext_method x = x
from project.Mod export ext_method

will export both My_Type.ext_method and Other_Type.ext_method.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.

@Akirathan Akirathan added the CI: No changelog needed Do not require a changelog entry for this PR. label Jun 13, 2024
@Akirathan Akirathan self-assigned this Jun 13, 2024
@Akirathan Akirathan force-pushed the wip/akirathan/10258-no-export-all branch from 09314ba to ae066c3 Compare June 17, 2024 12:07
@Akirathan Akirathan force-pushed the wip/akirathan/10258-no-export-all branch from ae066c3 to 994b912 Compare June 17, 2024 12:07
# Conflicts:
#	engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/analyse/BindingAnalysis.scala
#	engine/runtime-integration-tests/src/test/scala/org/enso/compiler/test/pass/analyse/BindingAnalysisTest.scala
#	engine/runtime/src/main/java/org/enso/interpreter/caches/ImportExportCache.java
return CollectionConverters.asJava(mod.getBindingsMap().definedEntities());
}

private static Map<String, List<ResolvedName>> getExportedSymbols(Module module) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method looks almost like a useful production code. module.getExportedSymbols would make same sense too.

@JaroslavTulach
Copy link
Member

There are four compilation failures IrUtilsTest.

Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests look OK. If CI gets green, feel free to proceed with integration.

docs/syntax/functions.md Outdated Show resolved Hide resolved
docs/syntax/functions.md Outdated Show resolved Hide resolved
docs/syntax/functions.md Outdated Show resolved Hide resolved
docs/syntax/functions.md Outdated Show resolved Hide resolved
@Akirathan Akirathan marked this pull request as ready for review June 25, 2024 10:30
@Akirathan Akirathan requested review from 4e6 and hubertp as code owners June 25, 2024 10:30
@Akirathan Akirathan added the CI: Ready to merge This PR is eligible for automatic merge label Jun 25, 2024
@mergify mergify bot merged commit 9010cf9 into develop Jun 25, 2024
42 checks passed
@mergify mergify bot deleted the wip/akirathan/10258-no-export-all branch June 25, 2024 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants