Skip to content
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

Add compiler pass that discovers ambiguous imports #6868

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7292123
Add AmbiguousImportAnalysis
Akirathan May 26, 2023
2738138
AmbiguousImportsAnalysis distinguishes between duplicated and ambiguo…
Akirathan May 31, 2023
74cd016
docs
Akirathan May 31, 2023
2590bfa
Merge branch 'develop' into wip/akirathan/6431-ambiguous-aliased-impo…
Akirathan May 31, 2023
9f2851d
Update changelog
Akirathan May 31, 2023
06bdbb1
AmbiguousImportAnalysis uses symbol full paths to determine ambiguity
Akirathan Jun 2, 2023
1325b60
Fix some tests - duplicated import is a warn, not error
Akirathan Jun 2, 2023
d8693b5
Improve compiler's diagnostic messages
Akirathan Jun 2, 2023
08efa41
Rename Extension.enso files
Akirathan Jun 2, 2023
c466b35
Add some docs
Akirathan Jun 5, 2023
cc4a672
Revert "Improve compiler's diagnostic messages"
Akirathan Jun 5, 2023
25f3d48
Remove Sort_Direction ambiguity from Vector.enso
Akirathan Jun 5, 2023
c952d4e
Remove temp debug logging
Akirathan Jun 5, 2023
41a0068
Fix multiple symbol importing.
Akirathan Jun 5, 2023
be394ea
Improve errors collection
Akirathan Jun 5, 2023
6cdc63e
Remove URI ambiguity in HTTP.enso
Akirathan Jun 5, 2023
c46a4ba
Remove duplicate imports
Akirathan Jun 6, 2023
e7cbf0d
Fix PassesTest
Akirathan Jun 6, 2023
c35f8e6
Fix hidden names case
Akirathan Jun 6, 2023
9b00b9b
Remove duplicate imports from Standard.Table
Akirathan Jun 6, 2023
6e817f6
Rename Standard.Test/Extensions to Test_Extensions
Akirathan Jun 6, 2023
b1e5809
Remove some ambiguous imports
Akirathan Jun 6, 2023
fdc9247
Remove some duplicate imports
Akirathan Jun 6, 2023
ca7e22a
Fix some imports after removals
Akirathan Jun 6, 2023
c0611ac
Remove some duplicate imports
Akirathan Jun 7, 2023
e377f17
fmt
Akirathan Jun 7, 2023
4bd05ea
Merge branch 'develop' into wip/akirathan/6431-ambiguous-aliased-impo…
Akirathan Jun 7, 2023
9f85a58
Fix Extensions module renames
Akirathan Jun 8, 2023
727ee80
Merge branch 'develop' into wip/akirathan/6431-ambiguous-aliased-impo…
Akirathan Jun 8, 2023
836b1b3
Fix more ambiguous imports
Akirathan Jun 8, 2023
d4da61c
Remove a Vector duplicate import
Akirathan Jun 8, 2023
1ae1414
Revert "Rename Extension.enso files"
Akirathan Jun 9, 2023
e8810d6
Revert Extensions module renaming
Akirathan Jun 9, 2023
11358e5
Remove duplicate import from a scala test
Akirathan Jun 9, 2023
2a9e19e
typo
Akirathan Jun 9, 2023
4ce6c07
Revert extensions module renaming
Akirathan Jun 9, 2023
0181c4c
Remove some duplicates
Akirathan Jun 9, 2023
3103fe4
Apply suggestions from code review
Akirathan Jun 9, 2023
e1cb0ce
Consistent naming of polyglot java imports
Akirathan Jun 9, 2023
5cb41fc
Hide symbols from more generic imports
Akirathan Jun 9, 2023
78375fa
Move Sort_Direction from Ordering module to Data
Akirathan Jun 9, 2023
7dfdd36
Use more specific imports in Std lib instead of import all
Akirathan Jun 9, 2023
a759efd
Revert examples documentation
Akirathan Jun 9, 2023
102e4f6
Revert extensions module renaming
Akirathan Jun 9, 2023
c99b608
Move Sort_Direction from Ordering module to Data
Akirathan Jun 9, 2023
0cca1a6
Fix after merge
Akirathan Jun 9, 2023
2b49036
Specific symbols are hidden from more generic imports
Akirathan Jun 9, 2023
b36b4b8
Remove unnecessary from.. Extensions import all statements
Akirathan Jun 9, 2023
dd77052
Apply some PR suggestions
Akirathan Jun 12, 2023
45ffd3a
Get rid of some more duplicated imports
Akirathan Jun 13, 2023
71e39e5
typo in docs
Akirathan Jun 13, 2023
608e69e
Fix builtin types test metadata
Akirathan Jun 13, 2023
47697eb
Revert "Get rid of some more duplicated imports"
Akirathan Jun 13, 2023
a0d2daf
Merge branch 'develop' into wip/akirathan/6431-ambiguous-aliased-impo…
Akirathan Jun 13, 2023
354b5f3
Remove unnecessary imports causing duplication warnings
Akirathan Jun 13, 2023
f291dec
Revert "Specific symbols are hidden from more generic imports"
Akirathan Jun 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,7 @@
- [Add project creation time to project metadata][6780]
- [Upgrade GraalVM to 22.3.1 JDK17][6750]
- [Ascribed types are checked during runtime][6790]
- [Add compiler pass that discovers ambiguous and duplicated symbols][6868]
- [Improve and colorize compiler's diagnostic messages][6931]
- [Execute some runtime commands synchronously to avoid race conditions][6998]

Expand Down Expand Up @@ -934,6 +935,7 @@
[6755]: https://github.com/enso-org/enso/pull/6755
[6780]: https://github.com/enso-org/enso/pull/6780
[6790]: https://github.com/enso-org/enso/pull/6790
[6868]: https://github.com/enso-org/enso/pull/6868
[6931]: https://github.com/enso-org/enso/pull/6931
[6998]: https://github.com/enso-org/enso/pull/6998

Expand Down
2 changes: 1 addition & 1 deletion distribution/lib/Standard/Base/0.0.0-dev/src/Any.enso
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import project.Data.Pair.Pair
import project.Data.Range.Extensions
from project.Data.Range.Extensions import all
import project.Data.Text.Text
import project.Data.Vector.Vector
import project.Error.Error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import project.Data.Numbers.Integer
import project.Data.Filter_Condition.Filter_Condition
import project.Data.List.List
import project.Data.Ordering.Ordering
import project.Data.Ordering.Sort_Direction.Sort_Direction
import project.Data.Sort_Direction.Sort_Direction
import project.Data.Pair.Pair
import project.Data.Range.Extensions
from project.Data.Range.Extensions import all
import project.Data.Range.Range
import project.Data.Text.Text
import project.Data.Vector.Vector
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import project.Any.Any
import project.Data.Boolean.Boolean
import project.Data.Text.Case_Sensitivity.Case_Sensitivity
import project.Data.Text.Extensions
from project.Data.Text.Extensions import all
import project.Data.Text.Regex
import project.Data.Text.Text
import project.Data.Vector.Vector
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import project.Any.Any
import project.Data.Numbers.Integer
import project.Data.Range.Range
import project.Data.Range.Extensions
from project.Data.Range.Extensions import all
import project.Data.Text.Text
import project.Data.Vector.Vector
import project.Errors.Common.Index_Out_Of_Bounds
Expand Down
6 changes: 3 additions & 3 deletions distribution/lib/Standard/Base/0.0.0-dev/src/Data/Json.enso
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import project.Any.Any
import project.Data.Array.Array
import project.Data.Array_Proxy.Array_Proxy
import project.Data.Json.Extensions
from project.Data.Json.Extensions import all
import project.Data.Map.Map
import project.Data.Numbers.Integer
import project.Data.Numbers.Number
import project.Data.Pair.Pair
import project.Data.Range.Extensions
import project.Data.Text.Extensions
from project.Data.Range.Extensions import all
from project.Data.Text.Extensions import all
import project.Data.Text.Text
import project.Data.Vector.Vector
import project.Errors.Common.Type_Error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import project.Data.Map.Map
import project.Data.Numbers.Decimal
import project.Data.Numbers.Integer
import project.Data.Numbers.Number
import project.Data.Range.Extensions
import project.Data.Text.Extensions
from project.Data.Range.Extensions import all
from project.Data.Text.Extensions import all
import project.Data.Text.Text
import project.Data.Text.Text_Sub_Range.Text_Sub_Range
import project.Data.Vector.Vector
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import project.Any.Any
import project.Data.Filter_Condition.Filter_Condition
import project.Data.Text.Case.Case
import project.Data.Text.Extensions
from project.Data.Text.Extensions import all
import project.Data.Text.Text
import project.Data.Vector.Vector
import project.Metadata.Display
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import project.Any.Any
import project.Data.Numbers.Integer
import project.Data.Vector.Vector
import project.Data.Pair.Pair
import project.Data.Text.Extensions
from project.Data.Text.Extensions import all
import project.Data.Text.Text
import project.Error.Error
import project.Errors.Illegal_Argument.Illegal_Argument
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import project.Any.Any
import project.Data.Boolean.Boolean
import project.Data.Numbers.Integer
import project.Data.Text.Text
import project.Data.Text.Extensions
from project.Data.Text.Extensions import all
import project.Data.Vector.Vector
import project.Errors.Common.Index_Out_Of_Bounds
import project.Errors.Common.Not_Found
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import project.Data.Numbers.Integer
import project.Data.Ordering.Comparable
import project.Data.Ordering.Ordering
import project.Data.Vector.Vector
import project.Data.Text.Extensions
from project.Data.Text.Extensions import all
import project.Data.Text.Text
import project.Errors.Illegal_Argument.Illegal_Argument
import project.Nothing.Nothing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import project.Data.Numbers.Integer
import project.Data.Numbers.Number
import project.Data.Ordering.Ordering
import project.Data.Ordering.Comparable
import project.Data.Range.Extensions
from project.Data.Range.Extensions import all
import project.Data.Vector.Vector
import project.Errors.Common.Incomparable_Values
import project.Error.Error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import project.Any.Any
import project.Data.Array.Array
import project.Data.Index_Sub_Range.Index_Sub_Range
import project.Data.Locale.Locale
import project.Data.Range.Extensions
from project.Data.Range.Extensions import all
import project.Data.Range.Range
import project.Data.Text.Case.Case
import project.Data.Text.Case_Sensitivity.Case_Sensitivity
Expand Down Expand Up @@ -38,7 +38,6 @@ import project.Nothing.Nothing
from project.Data.Boolean import Boolean, True, False
from project.Data.Json import Json, Invalid_JSON, JS_Object
from project.Data.Numbers import Decimal, Integer, Number, Number_Parse_Error
from project.Data.Text.Text_Sub_Range import Codepoint_Ranges, Text_Sub_Range

from project.Widget_Helpers import make_delimiter_selector

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import project.Any.Any
import project.Data.Map.Map
import project.Data.Numbers.Integer
import project.Data.Range.Extensions
from project.Data.Range.Extensions import all
import project.Data.Range.Range
import project.Data.Text.Regex.No_Such_Group
import project.Data.Text.Regex.Pattern.Pattern
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import project.Any.Any
import project.Data.Filter_Condition.Filter_Condition
import project.Data.Map.Map
import project.Data.Numbers.Integer
import project.Data.Range.Extensions
from project.Data.Range.Extensions import all
import project.Data.Range.Range
import project.Data.Text.Extensions
from project.Data.Text.Extensions import all
import project.Data.Text.Helpers
import project.Data.Text.Span.Span
import project.Data.Text.Span.Utf_16_Span
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import project.Data.Numbers.Integer
import project.Data.Text.Extensions
from project.Data.Text.Extensions import all
import project.Data.Text.Regex
import project.Data.Text.Regex.Match.Match
import project.Data.Text.Regex.No_Such_Group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import project.Data.Numbers.Integer
import project.Data.Pair.Pair
import project.Data.Range.Extensions
from project.Data.Range.Extensions import all
import project.Data.Range.Range
import project.Data.Text.Text
import project.Errors.Common.Index_Out_Of_Bounds
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import project.Data.Index_Sub_Range.Index_Sub_Range
import project.Data.Numbers.Integer
import project.Data.Pair.Pair
import project.Data.Range.Extensions
from project.Data.Range.Extensions import all
import project.Data.Range.Range
import project.Data.Text.Text
import project.Data.Vector.Vector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import project.Data.Filter_Condition.Filter_Condition
import project.Data.Json.JS_Object
import project.Data.Numbers.Integer
import project.Data.Range.Empty_Error
import project.Data.Range.Extensions
from project.Data.Range.Extensions import all
import project.Data.Text.Text
import project.Data.Time.Date.Date
import project.Data.Time.Date_Period.Date_Period
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import project.Data.Numbers.Decimal
import project.Data.Numbers.Integer
import project.Data.Ordering.Comparable
import project.Data.Pair.Pair
import project.Data.Text.Extensions
from project.Data.Text.Extensions import all
import project.Data.Text.Text
import project.Data.Time.Date_Time.Date_Time
import project.Data.Time.Period.Period
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import project.Any.Any
import project.Data.Json.JS_Object
import project.Data.Numbers.Integer
import project.Data.Ordering.Comparable
import project.Data.Text.Extensions
from project.Data.Text.Extensions import all
import project.Data.Text.Text
import project.Data.Time.Date.Date
import project.Data.Time.Duration.Duration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import project.Data.Filter_Condition.Filter_Condition
import project.Data.List.List
import project.Data.Map.Map
import project.Data.Numbers.Integer
import project.Data.Ordering.Sort_Direction.Sort_Direction
Akirathan marked this conversation as resolved.
Show resolved Hide resolved
import project.Data.Pair.Pair
import project.Data.Range.Range
import project.Data.Range.Extensions
from project.Data.Range.Extensions import all
import project.Data.Text.Text
import project.Data.Sort_Direction.Sort_Direction
import project.Errors.Common.Incomparable_Values
import project.Errors.Common.Index_Out_Of_Bounds
import project.Errors.Common.No_Such_Method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import project.Any.Any
import project.Data.Vector.Vector
import project.Error.Error
import project.Warning.Warning
from project import all

from project.Errors.Problem_Behavior.Problem_Behavior import all

Expand Down
20 changes: 10 additions & 10 deletions distribution/lib/Standard/Base/0.0.0-dev/src/Main.enso
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ import project.Data.Filter_Condition.Filter_Condition
import project.Data.Index_Sub_Range.Index_Sub_Range
import project.Data.Interval.Bound
import project.Data.Interval.Interval
import project.Data.Json.Extensions
from project.Data.Json.Extensions import all
import project.Data.Json.Json
import project.Data.Json.JS_Object
import project.Data.Locale.Locale
Expand All @@ -84,16 +84,16 @@ import project.Data.Ordering.Natural_Order
import project.Data.Ordering.Ordering
import project.Data.Ordering.Comparable
import project.Data.Ordering.Default_Comparator
import project.Data.Ordering.Sort_Direction.Sort_Direction
import project.Data.Sort_Direction.Sort_Direction
import project.Data.Pair.Pair
import project.Data.Range.Range
import project.Data.Range.Extensions
from project.Data.Range.Extensions import all
import project.Data.Regression
import project.Data.Statistics
import project.Data.Text.Case.Case
import project.Data.Text.Case_Sensitivity.Case_Sensitivity
import project.Data.Text.Encoding.Encoding
import project.Data.Text.Extensions
from project.Data.Text.Extensions import all
import project.Data.Text.Line_Ending_Style.Line_Ending_Style
import project.Data.Text.Location.Location
import project.Data.Text.Matching_Mode.Matching_Mode
Expand All @@ -112,7 +112,7 @@ import project.Data.Time.Time_Of_Day.Time_Of_Day
import project.Data.Time.Time_Period.Time_Period
import project.Data.Time.Time_Zone.Time_Zone
import project.Errors.Problem_Behavior.Problem_Behavior
import project.Network.Extensions
from project.Network.Extensions import all
import project.Network.HTTP.Header.Header
import project.Network.HTTP.HTTP
import project.Network.HTTP.HTTP_Method.HTTP_Method
Expand All @@ -126,7 +126,7 @@ export project.Data.Filter_Condition.Filter_Condition
export project.Data.Index_Sub_Range.Index_Sub_Range
export project.Data.Interval.Bound
export project.Data.Interval.Interval
export project.Data.Json.Extensions
from project.Data.Json.Extensions export all
export project.Data.Json.Json
export project.Data.Json.JS_Object
export project.Data.Locale.Locale
Expand All @@ -135,15 +135,15 @@ export project.Data.Ordering.Natural_Order
export project.Data.Ordering.Ordering
export project.Data.Ordering.Comparable
export project.Data.Ordering.Default_Comparator
export project.Data.Ordering.Sort_Direction.Sort_Direction
export project.Data.Pair.Pair
export project.Data.Range.Range
export project.Data.Range.Extensions
from project.Data.Range.Extensions export all
export project.Data.Regression
export project.Data.Sort_Direction.Sort_Direction
export project.Data.Text.Case.Case
export project.Data.Text.Case_Sensitivity.Case_Sensitivity
export project.Data.Text.Encoding.Encoding
export project.Data.Text.Extensions
from project.Data.Text.Extensions export all
export project.Data.Text.Line_Ending_Style.Line_Ending_Style
export project.Data.Text.Location.Location
export project.Data.Text.Matching_Mode.Matching_Mode
Expand All @@ -162,7 +162,7 @@ export project.Data.Time.Time_Of_Day.Time_Of_Day
export project.Data.Time.Time_Period.Time_Period
export project.Data.Time.Time_Zone.Time_Zone
export project.Errors.Problem_Behavior.Problem_Behavior
export project.Network.Extensions
from project.Network.Extensions export all
export project.Network.HTTP.Header.Header
export project.Network.HTTP.HTTP
export project.Network.HTTP.HTTP_Method.HTTP_Method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ polyglot java import java.net.http.HttpRequest
polyglot java import java.net.http.HttpResponse
polyglot java import java.net.InetSocketAddress
polyglot java import java.net.ProxySelector
polyglot java import java.net.URI
polyglot java import java.time.Duration as Java_Duration
polyglot java import org.enso.base.Http_Utils

type HTTP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import project.Any.Any
import project.Data.Pair.Pair
import project.Data.Text.Text
import project.Data.Vector.Vector
import project.Network.Extensions
from project.Network.Extensions import all
import project.Network.HTTP.Form.Form
import project.Network.HTTP.Header.Header
import project.Network.HTTP.HTTP_Method.HTTP_Method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import project.Data.Boolean.Boolean
import project.Data.Json.JS_Object
import project.Data.Numbers.Number
import project.Data.Text.Encoding.Encoding
import project.Data.Text.Extensions
from project.Data.Text.Extensions import all
import project.Data.Text.Text
import project.Data.Vector.Vector
import project.Error.Error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import project.Data.Json.Json
import project.Data.Json.JS_Object
import project.Data.Numbers.Number
import project.Data.Text.Encoding.Encoding
import project.Data.Text.Extensions
from project.Data.Text.Extensions import all
import project.Data.Text.Text
import project.Data.Vector.Vector
import project.Nothing.Nothing
Expand Down
1 change: 0 additions & 1 deletion distribution/lib/Standard/Base/0.0.0-dev/src/Random.enso
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import project.Data.Numbers.Decimal
import project.Data.Text.Text
import project.Data.Vector.Vector
import project.Data.Json.JS_Object
import project.Data.Text.Text
import project.Error.Error
import project.Errors.Illegal_Argument.Illegal_Argument
import project.System
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import project.Any.Any
import project.Data.Array.Array
import project.Data.Boolean.Boolean
import project.Data.Text.Case.Case
import project.Data.Text.Extensions
from project.Data.Text.Extensions import all
import project.Data.Text.Text
import project.Data.Vector.Vector
import project.Errors.Common.Forbidden_Operation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from Standard.Base import all
import project.Any.Any
import project.Data.Array.Array
import project.Data.Index_Sub_Range.Index_Sub_Range
Expand All @@ -24,6 +23,7 @@ import project.Runtime.Context
import project.Runtime.Managed_Resource.Managed_Resource
import project.System.File.File_Access.File_Access
import project.System.File.File_Permissions.File_Permissions
import project.Warning.Warning

from project.Data.Boolean import Boolean, True, False
from project.System.File_Format import Auto_Detect, File_Format
Akirathan marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import project.Data.Text.Text
import project.Data.Text.Encoding.Encoding
import project.Data.Text.Extensions
from project.Data.Text.Extensions import all
import project.Data.Vector.Vector
import project.Error.Error
import project.Errors.Common.Unsupported_Argument_Types
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import project.Any.Any
import project.Data.Json.Json
import project.Data.Text.Encoding.Encoding
import project.Data.Text.Extensions
from project.Data.Text.Extensions import all
import project.Data.Text.Text
import project.Data.Vector.Vector
import project.Error.Error
Expand Down
Loading