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

[SR-9611] https://github.com/SwiftJava/SwiftJava does not build since 18th dec. #52057

Closed
johnno1962 opened this issue Jan 7, 2019 · 9 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself regression swift 5.0 type checker Area → compiler: Semantic analysis

Comments

@johnno1962
Copy link
Contributor

Previous ID SR-9611
Radar None
Original Reporter @johnno1962
Type Bug
Status Closed
Resolution Done
Environment

Xcode 10.1, macOS 10.13.6 (17G3025).

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 5.0Regression, TypeChecker
Assignee @DougGregor
Priority Medium

md5: b5f4c9e53d8bf5f77767dc1baf270540

Issue Description:

Hi Apple,

I’m seeing a strange problem where the project https://github.com/SwiftJava/SwiftJava target “examples” does not build using an Apple toolchain built from master since the 18th December i.e.:

swift-DEVELOPMENT-SNAPSHOT-2018-12-17-a.pkg can build this project
swift-DEVELOPMENT-SNAPSHOT-2018-12-18-a.pkg gives errors including:

/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22: error: type of expression is ambiguous without more context
        let colors = ["Blue", "Yellow", "Red"]
                     ^~~~~~~~~~~~~~~~~~~~~~~~~

There isn’t much that’s strange about the project though I did notice that the size of the toolchain as reported by Xcode increased by 5mb the same day the code stopped working (Result perhaps? though that is complete speculation.) The most recent master development toolchain still exhibits this error as does Linux + SPM. As a side note this project builds perhaps 2-3 times more quickly than it used to – Thanks!

@johnno1962
Copy link
Contributor Author

Constraint solver on versions after the 18th (master in this case) says:

---Constraint solving for the expression at [/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 - line:43:46]---
---Initial constraints for the given expression---
(array_expr type='$T3' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 - line:43:46]
  (string_literal_expr type='$T0' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 - line:43:23] encoding=utf8 value="Blue" builtin_initializer=**NULL** initializer=**NULL**)
  (string_literal_expr type='$T1' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31 - line:43:31] encoding=utf8 value="Yellow" builtin_initializer=**NULL** initializer=**NULL**)
  (string_literal_expr type='$T2' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41 - line:43:41] encoding=utf8 value="Red" builtin_initializer=**NULL** initializer=**NULL**))
Score: 0 0 0 0 0 0 0 0 0 0 0
Type Variables:
  $T0 fully_bound literal=3 involves_type_vars bindings={(subtypes of) (default from ExpressibleByStringLiteral) String} @ locator@0x10a123e00 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23]
  $T1 equivalent to $T0 @ locator@0x10a123ea0 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31]
  $T2 equivalent to $T0 @ locator@0x10a123f40 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41]
  $T3 literal=1 bindings={(subtypes of) (default from ExpressibleByArrayLiteral) Array} @ locator@0x10a123fe0 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22]

Active Constraints:

Inactive Constraints:
  $T0 literal conforms to ExpressibleByStringLiteral [[locator@0x10a123e00 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23]]];
  $T1 literal conforms to ExpressibleByStringLiteral [[locator@0x10a123ea0 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31]]];
  $T2 literal conforms to ExpressibleByStringLiteral [[locator@0x10a123f40 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41]]];
  $T3 literal conforms to ExpressibleByArrayLiteral [[locator@0x10a123fe0 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22]]];
  $T0 conv $T3.ArrayLiteralElement [[locator@0x10a1240a0 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 -> tuple element #​0]]];
  $T1 conv $T3.ArrayLiteralElement [[locator@0x10a124128 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 -> tuple element #​1]]];
  $T2 conv $T3.ArrayLiteralElement [[locator@0x10a1241b0 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 -> tuple element #​2]]];
  $T3.ArrayLiteralElement can default to Any [[locator@0x10a123fe0 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22]]];
  ($T0 fully_bound literal=3 involves_type_vars bindings={(subtypes of) (default from ExpressibleByStringLiteral) String})
  ($T3 literal=1 bindings={(subtypes of) (default from ExpressibleByArrayLiteral) Array})
  Initial bindings: $T3 := Array
  (attempting type variable $T3 := Array
    (failed constraint $T3 literal conforms to ExpressibleByArrayLiteral [[locator@0x10a123fe0 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22]]];)
  )
---Solver statistics---
Total number of scopes explored: 2
Maximum depth reached while exploring solutions: 2
Time: 8.010000e-01ms
---Attempting to salvage and emit diagnostics---
  ($T0 fully_bound literal=3 involves_type_vars bindings={(subtypes of) (default from ExpressibleByStringLiteral) String})
  ($T3 literal=1 bindings={(subtypes of) (default from ExpressibleByArrayLiteral) Array})
  Initial bindings: $T3 := Array
  (attempting type variable $T3 := Array
    (failed constraint $T3 literal conforms to ExpressibleByArrayLiteral [[locator@0x10a123fe0 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22]]];)
  )
---Constraint solving for the expression at [/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 - line:43:23]---
---Initial constraints for the given expression---
(string_literal_expr type='$T0' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 - line:43:23] encoding=utf8 value="Blue" builtin_initializer=**NULL** initializer=**NULL**)
Score: 0 0 0 0 0 0 0 0 0 0 0
Type Variables:
  $T0 literal=3 bindings={(subtypes of) (default from ExpressibleByStringLiteral) String} @ locator@0x10a13dc00 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23]

Active Constraints:

Inactive Constraints:
  $T0 literal conforms to ExpressibleByStringLiteral [[locator@0x10a13dc00 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23]]];
  ($T0 literal=3 bindings={(subtypes of) (default from ExpressibleByStringLiteral) String})
  Initial bindings: $T0 := String
  (attempting type variable $T0 := String
    (found solution 0 0 0 0 0 0 0 0 0 0 0)
  )
---Solver statistics---
Total number of scopes explored: 2
Maximum depth reached while exploring solutions: 2
Time: 1.224000e+00ms
---Solution---
Fixed score: 0 0 0 0 0 0 0 0 0 0 0
Type variables:
  $T0 as String @ locator@0x10a13dc00 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23]

Overload choices:

Constraint restrictions:

Disjunction choices:
---Type-checked expression---
(string_literal_expr type='String' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 - line:43:23] encoding=utf8 value="Blue" builtin_initializer=Swift.(file).String extension.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:) initializer=**NULL**)
---Constraint solving for the expression at [/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31 - line:43:31]---
---Initial constraints for the given expression---
(string_literal_expr type='$T0' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31 - line:43:31] encoding=utf8 value="Yellow" builtin_initializer=**NULL** initializer=**NULL**)
Score: 0 0 0 0 0 0 0 0 0 0 0
Type Variables:
  $T0 literal=3 bindings={(subtypes of) (default from ExpressibleByStringLiteral) String} @ locator@0x10a13dc00 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31]

Active Constraints:

Inactive Constraints:
  $T0 literal conforms to ExpressibleByStringLiteral [[locator@0x10a13dc00 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31]]];
  ($T0 literal=3 bindings={(subtypes of) (default from ExpressibleByStringLiteral) String})
  Initial bindings: $T0 := String
  (attempting type variable $T0 := String
    (found solution 0 0 0 0 0 0 0 0 0 0 0)
  )
---Solver statistics---
Total number of scopes explored: 2
Maximum depth reached while exploring solutions: 2
Time: 1.619000e+00ms
---Solution---
Fixed score: 0 0 0 0 0 0 0 0 0 0 0
Type variables:
  $T0 as String @ locator@0x10a13dc00 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31]

Overload choices:

Constraint restrictions:

Disjunction choices:
---Type-checked expression---
(string_literal_expr type='String' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31 - line:43:31] encoding=utf8 value="Yellow" builtin_initializer=Swift.(file).String extension.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:) initializer=**NULL**)
---Constraint solving for the expression at [/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41 - line:43:41]---
---Initial constraints for the given expression---
(string_literal_expr type='$T0' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41 - line:43:41] encoding=utf8 value="Red" builtin_initializer=**NULL** initializer=**NULL**)
Score: 0 0 0 0 0 0 0 0 0 0 0
Type Variables:
  $T0 literal=3 bindings={(subtypes of) (default from ExpressibleByStringLiteral) String} @ locator@0x10a13dc00 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41]

Active Constraints:

Inactive Constraints:
  $T0 literal conforms to ExpressibleByStringLiteral [[locator@0x10a13dc00 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41]]];
  ($T0 literal=3 bindings={(subtypes of) (default from ExpressibleByStringLiteral) String})
  Initial bindings: $T0 := String
  (attempting type variable $T0 := String
    (found solution 0 0 0 0 0 0 0 0 0 0 0)
  )
---Solver statistics---
Total number of scopes explored: 2
Maximum depth reached while exploring solutions: 2
Time: 2.008000e+00ms
---Solution---
Fixed score: 0 0 0 0 0 0 0 0 0 0 0
Type variables:
  $T0 as String @ locator@0x10a13dc00 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41]

Overload choices:

Constraint restrictions:

Disjunction choices:
---Type-checked expression---
(string_literal_expr type='String' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41 - line:43:41] encoding=utf8 value="Red" builtin_initializer=Swift.(file).String extension.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:) initializer=**NULL**)
---Constraint solving for the expression at [/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 - line:43:46]---
---Initial constraints for the given expression---
(array_expr type='$T0' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 - line:43:46]
  (string_literal_expr type='String' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 - line:43:23] encoding=utf8 value="Blue" builtin_initializer=Swift.(file).String extension.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:) initializer=**NULL**)
  (string_literal_expr type='String' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31 - line:43:31] encoding=utf8 value="Yellow" builtin_initializer=Swift.(file).String extension.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:) initializer=**NULL**)
  (string_literal_expr type='String' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41 - line:43:41] encoding=utf8 value="Red" builtin_initializer=Swift.(file).String extension.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:) initializer=**NULL**))
Score: 0 0 0 0 0 0 0 0 0 0 0
Type Variables:
  $T0 literal=1 bindings={(subtypes of) (default from ExpressibleByArrayLiteral) Array} @ locator@0x10a13dc00 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22]

Active Constraints:

Inactive Constraints:
  $T0 literal conforms to ExpressibleByArrayLiteral [[locator@0x10a13dc00 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22]]];
  String conv $T0.ArrayLiteralElement [[locator@0x10a13dcc0 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 -> tuple element #​0]]];
  String conv $T0.ArrayLiteralElement [[locator@0x10a13dd40 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 -> tuple element #​1]]];
  String conv $T0.ArrayLiteralElement [[locator@0x10a13ddc0 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 -> tuple element #​2]]];
  $T0.ArrayLiteralElement can default to Any [[locator@0x10a13dc00 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22]]];
  ($T0 literal=1 bindings={(subtypes of) (default from ExpressibleByArrayLiteral) Array})
  Initial bindings: $T0 := Array
  (attempting type variable $T0 := Array
    (failed constraint $T0 literal conforms to ExpressibleByArrayLiteral [[locator@0x10a13dc00 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22]]];)
  )
---Solver statistics---
Total number of scopes explored: 2
Maximum depth reached while exploring solutions: 2
Time: 2.711000e+00ms
---Attempting to salvage and emit diagnostics---
  ($T0 literal=1 bindings={(subtypes of) (default from ExpressibleByArrayLiteral) Array})
  Initial bindings: $T0 := Array
  (attempting type variable $T0 := Array
    (failed constraint String conv $T0.ArrayLiteralElement [[locator@0x10a13dcc0 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 -> tuple element #​0]]];)
  )

@johnno1962
Copy link
Contributor Author

Versions from 17th dec or before give:

---Constraint solving for the expression at [/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 - line:43:46]---
---Initial constraints for the given expression---
(array_expr type='$T3' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 - line:43:46]
  (string_literal_expr type='$T0' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 - line:43:23] encoding=utf8 value="Blue" builtin_initializer=**NULL** initializer=**NULL**)
  (string_literal_expr type='$T1' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31 - line:43:31] encoding=utf8 value="Yellow" builtin_initializer=**NULL** initializer=**NULL**)
  (string_literal_expr type='$T2' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41 - line:43:41] encoding=utf8 value="Red" builtin_initializer=**NULL** initializer=**NULL**))
Score: 0 0 0 0 0 0 0 0 0 0 0
Type Variables:
  $T0 fully_bound literal=3 involves_type_vars bindings={(subtypes of) (default from ExpressibleByStringLiteral) String} @ locator@0x7fde5b004200 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23]
  $T1 equivalent to $T0 @ locator@0x7fde5b0042a0 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31]
  $T2 equivalent to $T0 @ locator@0x7fde5b004340 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41]
  $T3 literal=1 bindings={(subtypes of) (default from ExpressibleByArrayLiteral) Array} @ locator@0x7fde5b0043e0 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22]

Active Constraints:

Inactive Constraints:
  $T0 literal conforms to ExpressibleByStringLiteral [[locator@0x7fde5b004200 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23]]];
  $T1 literal conforms to ExpressibleByStringLiteral [[locator@0x7fde5b0042a0 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31]]];
  $T2 literal conforms to ExpressibleByStringLiteral [[locator@0x7fde5b004340 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41]]];
  $T3 literal conforms to ExpressibleByArrayLiteral [[locator@0x7fde5b0043e0 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22]]];
  $T0 conv $T3.ArrayLiteralElement [[locator@0x7fde5b0044a0 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 -> tuple element #​0]]];
  $T1 conv $T3.ArrayLiteralElement [[locator@0x7fde5b004528 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 -> tuple element #​1]]];
  $T2 conv $T3.ArrayLiteralElement [[locator@0x7fde5b0045b0 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 -> tuple element #​2]]];
  $T3.ArrayLiteralElement can default to Any [[locator@0x7fde5b0043e0 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22]]];
  ($T0 fully_bound literal=3 involves_type_vars bindings={(subtypes of) (default from ExpressibleByStringLiteral) String})
  ($T3 literal=1 bindings={(subtypes of) (default from ExpressibleByArrayLiteral) Array})
  Initial bindings: $T3 := Array
  (attempting type variable $T3 := Array
    ($T0 literal=3 involves_type_vars bindings={(subtypes of) (default from ExpressibleByStringLiteral) String})
    ($T4 involves_type_vars #defaultable_bindings=1 bindings={Any})
    Initial bindings: $T0 := String
    (attempting type variable $T0 := String
      ($T4 #defaultable_bindings=1 bindings={(supertypes of) String; Any})
      Initial bindings: $T4 := String, $T4 := Any
      (attempting type variable $T4 := String
        (found solution 0 0 0 0 0 0 0 0 0 0 0)
      )
    )
  )
---Solver statistics---
Total number of scopes explored: 4
Maximum depth reached while exploring solutions: 4
Time: 2.416000e+00ms
---Solution---
Fixed score: 0 0 0 0 0 0 0 0 0 0 0
Type variables:
  $T0 as String @ locator@0x7fde5b004200 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23]
  $T4 as String @ locator@0x7fde5b004698 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 -> generic parameter 'Element']
  $T1 as String @ locator@0x7fde5b0042a0 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31]
  $T2 as String @ locator@0x7fde5b004340 [StringLiteral@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41]
  $T3 as [String] @ locator@0x7fde5b0043e0 [Array@/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22]

Overload choices:

Constraint restrictions:

Disjunction choices:
  (found solution 0 0 0 0 0 0 0 0 0 0 0)
---Solver statistics---
Total number of scopes explored: 1
Maximum depth reached while exploring solutions: 1
---Type-checked expression---
(array_expr type='[String]' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 - line:43:46]
  (string_literal_expr type='String' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 - line:43:23] encoding=utf8 value="Blue" builtin_initializer=Swift.(file).String extension.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:) initializer=**NULL**)
  (string_literal_expr type='String' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31 - line:43:31] encoding=utf8 value="Yellow" builtin_initializer=Swift.(file).String extension.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:) initializer=**NULL**)
  (string_literal_expr type='String' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41 - line:43:41] encoding=utf8 value="Red" builtin_initializer=Swift.(file).String extension.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:) initializer=**NULL**)
  (semantic_expr
    (call_expr implicit type='[String]' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 - line:43:41] arg_labels=arrayLiteral:_:_:
      (constructor_ref_call_expr implicit type='(String...) -> [String]' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 - line:43:22]
        (declref_expr implicit type='(Array<String>.Type) -> (String...) -> [String]' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 - line:43:22] decl=Swift.(file).Array extension.init(arrayLiteral:) [with (substitution_map generic_signature=<Element> (substitution Element -> String))] function_ref=single)
        (type_expr implicit type='[String].Type' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:22 - line:43:22] typerepr='[String]'))
      (tuple_shuffle_expr implicit type='(arrayLiteral: String...)' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 - line:43:41] tuple_to_tuple elements=[-2] variadic_sources=[0, 1, 2] default_args_owner=Swift.(file).Array extension.init(arrayLiteral:) [with (substitution_map generic_signature=<Element> (substitution Element -> String))]
        (tuple_expr implicit type='(arrayLiteral: String, String, String)' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 - line:43:41] names=arrayLiteral,'',''
          (string_literal_expr type='String' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:23 - line:43:23] encoding=utf8 value="Blue" builtin_initializer=Swift.(file).String extension.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:) initializer=**NULL**)
          (string_literal_expr type='String' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:31 - line:43:31] encoding=utf8 value="Yellow" builtin_initializer=Swift.(file).String extension.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:) initializer=**NULL**)
          (string_literal_expr type='String' location=/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41 range=[/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:43:41 - line:43:41] encoding=utf8 value="Red" builtin_initializer=Swift.(file).String extension.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:) initializer=**NULL**))))))
---Constraint solving for the expression at [/Volumes/Elements/SwiftJava/examples/Sources/PopupTest.swift:44:26 - line:44:38]—

@johnno1962
Copy link
Contributor Author

Sems to be side effect related to: 9f61301
"[Name lookup] Enable shadowing for type lookup and of the Swift module.”

If I reverse this commit out the problem goes away.

@belkadan
Copy link
Contributor

belkadan commented Jan 7, 2019

cc @DougGregor, @xedin

@DougGregor
Copy link
Member

I bet SwiftJava has a type named Array. I managed to reduce this:

struct Array { }
func foo() {
  _ = ["a", "b", "c"]
} 

@DougGregor
Copy link
Member

Fix is here: #21678

@DougGregor
Copy link
Member

Also for 5.0 branch: #21681

@johnno1962
Copy link
Contributor Author

Thanks Doug. Fix checks out this end.

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Jul 23, 2019

Marking the bug as "Closed" since the fix has been confirmed.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself regression swift 5.0 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

4 participants