apple / pkl-intellij

JetBrains editor plugins providing Pkl language support
https://pkl-lang.org/intellij/current/index.html
Apache License 2.0
49 stars 10 forks source link

Incorrect type mismatch when conflicting dependencies in project with multiple packages #23

Closed bioball closed 1 month ago

bioball commented 5 months ago

Given the following setup:

PackageA/ -> depends on PackageC@1.1.0 PackageB/ -> depends on ../PackageA, PackageC@1.2.0

And PackageA has the following

// MyModule.pkl
import "@packageC/Something.pkl"

something: Something

Then usage from PackageB:

amends "@packageA/MyModule.pkl"
import "@packageC/Something.pkl"

something = new Something {}

This results in an incorrect type error in IntellijJ (one sees PackageC@1.1.0, another sees PackageC@1.2.0).

Screenshot of real life example:

Screenshot 2024-04-09 at 3 56 49 PM

This error can be seen in this commit: https://github.com/apple/pkl-intellij/commit/d238a01b6a9666911b1b08fc9ebd08fbd0d42307

And in file packages/k8s.contrib.crd/internal/ModuleGenerator.pkl

bioball commented 1 month ago

Fixed in 0.28.0