You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When multiple modules define extension methods with the same name and for the same type and both modules are imported, resolution of that method is not deterministic.
Steps to Reproduce
Create new project (here called Multitest) with the following files:
File1.enso:
from Base import all
Number.foo = 42
File2.enso:
from Base import all
Number.foo = "answer"
Main.enso:
from Base import all
import Multitest.File1
import Multitest.File2
main =
a = 23.foo
IO.println a
The above code should result in an ambiguity error.
Ideally, the error should be detected when importing the module that brings the ambiguous resolution. If that's not possible, executing that method in runtime should yield a runtime error indicating the ambiguity.
Actual Result
The program sometimes prints answer and sometimes 42, behaving nondeterministically.
The text was updated successfully, but these errors were encountered:
This task is automatically imported from the old Task Issue Board and it was originally created by Radosław Waśko.
Original issue is here.
Migrated from #1243
General Summary
When multiple modules define extension methods with the same name and for the same type and both modules are imported, resolution of that method is not deterministic.
Steps to Reproduce
Multitest
) with the following files:File1.enso
:File2.enso
:Main.enso
:Or download the project from here: multitest.zip
Expected Result
The above code should result in an ambiguity error.
Ideally, the error should be detected when importing the module that brings the ambiguous resolution. If that's not possible, executing that method in runtime should yield a runtime error indicating the ambiguity.
Actual Result
The program sometimes prints
answer
and sometimes42
, behaving nondeterministically.The text was updated successfully, but these errors were encountered: