Tensegritics / Tensegritics/ClojureDart
Resolution of types across conditional import/export
Nobody has claimed this yet.
- Dominant language
- Clojure
- Stars
- 1.6k
- Forks
- 119
- PR merge metrics
- No merged PRs in 30d
Description
file_picker uses cross_file.
The CLJD compiler resolves XFile classes to the one in the stub types/interface.dart and add explicit import to this file from the compiled ns while it should not "see through" the conditional export and stops at least at src/x_file.dart (or maybe better at .package:cross_file/cross_file.dart which is the last public export of XFile)
So we need to come up with a rule to determine the canonical lib when a conditional export (what would be the cases with an import?) is met.
Regarding stopping at the last public export for canonical resolution (see stroke-through text above) I think it's a bad idea. Here's why: one private lib can be re-exported from multiple public libs and the Dart compiler will be able to tell it's the same type. If we stop at the last public for canonical lib we won't be able to identify two exports of the same class as identical.
I'm confident that we added canonical libs to fix this exact issue.
Thus conditional imports are a special twist and should not change the way we resolve regular libs.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the Dart guide on conditional imports and exports, then compare file_picker's lib/src/platform_file.dart with cross_file's lib/src/x_file.dart and the stub types/interface.dart. Trace the CLJD compiler's canonical-library resolution and compiled namespace imports. Done means conditional exports no longer resolve XFile to the stub while regular library identity remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure, dart, flutter
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100