Replies: 1 comment 1 reply
-
I definitely see the reason you might want this. However, this can introduce quite hidden bugs. If the parent's imports were resolvable in an amending module, this means that you can possibly change the meaning of a variable in a child module by simply adding an import. For example: // parent.pkl
class Bird {
name: String
scientificName: String
}
bird: Bird // child.pkl
amends "parent.pkl"
bird {
scientificName = name // `name` is not in lexical scope, fall back to looking up `this.name`
} Here, If we allowed the child module to see imports declared in the parent, that means that we can change what // parent.pkl
+import "name.pkl"
class Bird {
name: String
scientificName: String
}
bird: Bird This type of behavior can cause hidden bugs; adding a new import can unintentionally cause a variable's resolution to change. |
Beta Was this translation helpful? Give feedback.
-
Allowing to have implicit imports would remove the boilerplate of splitting up files.
Current use case would be to not need to reimport all the Kubernetes imports for each file.
Beta Was this translation helpful? Give feedback.
All reactions