-
Notifications
You must be signed in to change notification settings - Fork 324
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
Verify ascribed types of parameters really exist #6584
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding tests to TypeSignaturesTest.scala
would probably be less amount of work, since there are already some tests.
engine/runtime/src/main/scala/org/enso/compiler/pass/resolve/TypeSignatures.scala
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/scala/org/enso/compiler/pass/resolve/TypeNames.scala
Outdated
Show resolved
Hide resolved
There is a lot of unresolved symbols when parsing the standard library. I was investigating it and it seems to me that
filled with symbols properly, but then it gets created once again and this time the symbols remain empty:
Update: solved by 0711186 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits
engine/runtime/src/main/scala/org/enso/compiler/pass/resolve/TypeSignatures.scala
Outdated
Show resolved
Hide resolved
engine/runtime/src/test/java/org/enso/interpreter/test/SignatureTest.java
Show resolved
Hide resolved
engine/runtime/src/main/scala/org/enso/compiler/pass/resolve/TypeNames.scala
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/scala/org/enso/compiler/pass/resolve/TypeSignatures.scala
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/scala/org/enso/compiler/pass/resolve/TypeNames.scala
Outdated
Show resolved
Hide resolved
Thank you all for your help. These three lines are causing all the failures: enso$ git diff
diff --git engine/runtime/src/main/scala/org/enso/compiler/pass/resolve/TypeSignatures.scala engine/runtime/src/main/scala/org/enso/compiler/pass/resolve/TypeSignatures.scala
index bbe19d43fc..5be235da81 100644
--- engine/runtime/src/main/scala/org/enso/compiler/pass/resolve/TypeSignatures.scala
+++ engine/runtime/src/main/scala/org/enso/compiler/pass/resolve/TypeSignatures.scala
@@ -134,9 +134,9 @@ case object TypeSignatures extends IRPass {
lastSignature = None
res
case ut: IR.Module.Scope.Definition.Type =>
- ut.members.foreach(d => {
- verifyAscribedArguments(d.arguments)
- })
+ //ut.members.foreach(d => {
+ // verifyAscribedArguments(d.arguments)
+ //})
Some(ut.mapExpressions(resolveExpression))
case err: IR.Error => Some(err)
case ann: IR.Name.GenericAnnotation => Some(ann) Update: solved by 0711186 |
engine/runtime/src/test/java/org/enso/interpreter/test/SignatureTest.java
Show resolved
Hide resolved
Co-authored-by: Hubert Plociniczak <hubert.plociniczak@gmail.com>
c52e045
to
6e2ce12
Compare
Co-authored-by: Hubert Plociniczak <hubert.plociniczak@gmail.com>
Dropping the caches didn't help - the failure is still there. The following patch seems to help me locally: #6135 (comment) |
engine/runtime/src/main/scala/org/enso/compiler/phase/ImportResolver.scala
Outdated
Show resolved
Hide resolved
There is a:
|
Looks like the first test in enso$ git diff
diff --git engine/runtime/src/test/scala/org/enso/compiler/test/pass/resolve/TypeNamesTest.scala engine/runtime/src/test/scala/org/enso/compiler/test/pass/resolve/TypeNamesTest.scala
index a7147210cb..b00cfe4191 100644
--- engine/runtime/src/test/scala/org/enso/compiler/test/pass/resolve/TypeNamesTest.scala
+++ engine/runtime/src/test/scala/org/enso/compiler/test/pass/resolve/TypeNamesTest.scala
@@ -76,7 +76,7 @@ class TypeNamesTest extends CompilerTest {
"Resolution of type names in modules" should {
implicit val ctx: ModuleContext = mkModuleContext
- "should correctly resolve local type names" in {
+ "should correctly resolve local type names" ignore {
val ir =
"""
|type A |
@@ -102,6 +108,7 @@ public boolean isBefore(CompilationStage stage) { | |||
private boolean hasCrossModuleLinks; | |||
private final boolean synthetic; | |||
private List<QualifiedName> directModulesRefs; | |||
private BindingsMap bindings; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have hard times understanding why this field is needed. Why can't we operate with the BindingsMap
only via ir.unsafeGetMetadata(BindingAnalysis)
? How do we ensure that the values of this field will always be exactly the same as the value of this.ir.unsafeGetMetadata(BindingAnalysis)
? Note that the BindingAnalysis
phase is run on a particular module prior to import resolution, which means that the BindingMap
is available soon.
Why cannot the problems with caches be resolved only via this.ir.usafeGetMetadata(BindingAnalysis)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not 100% sure yet, but it seems that when the BindingsMap
gets read from stdlib caches, there are some inconsistencies.
When the caches exist the BindingsMap
gets created sooner than IR
. That's good, for purposes of #6100 we don't want to load IR just to resolve imports. However that means, having BindingsMap
inside of IR
is problematic in any case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BindingMap
not being part of IR
's metadata sounds reasonable. In that case, I would forbid to access BindingMap
via ir.getMetadata
, and only implement one way of accessing BindingMap
- for example via Module.getBindings
. I have a feeling that it is a bad idea for BindingMap
to extend IRPass.Metadata
anyway, since it is somewhat special in a sense that this metadata is filled even before import resolution starts. We should probably refactor BindingMap
such that it is an internal part of the compiler and it is tightly coupled with a particular Module
. What do you think?
3dddf00
to
f2df70c
Compare
engine/runtime/src/main/scala/org/enso/compiler/pass/resolve/TypeNames.scala
Outdated
Show resolved
Hide resolved
…z-6260 * develop: Build nightlies every day. (#6681) Force `newDashboard` default on the CI-built packages. (#6680) Verify ascribed types of parameters really exist (#6584) SuggestionBuilder needs to send ascribedType of constructor parameters (#6655) Improvements to the Table visualization. (#6653) Removing flush (#6670) Improving widgets for take/drop (#6641)
* develop: Build nightlies every day. (#6681) Force `newDashboard` default on the CI-built packages. (#6680) Verify ascribed types of parameters really exist (#6584) SuggestionBuilder needs to send ascribedType of constructor parameters (#6655) Improvements to the Table visualization. (#6653) Removing flush (#6670) Improving widgets for take/drop (#6641) disable authentication and newDashboard by default (#6664) Add COOP+COEP+CORP headers (#6646)
Pull Request Description
Verify ascribed types
(a : Xyz)
are checked for existence.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
style guides.