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

Redundant errors in synthesized makeIterator call on conflicting generic arguments in for-in sequence expression #72818

Open
AnthonyLatsis opened this issue Apr 3, 2024 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation for-in loops Feature: for-in loops generics Feature: generic declarations and types statements Feature: statements swift 6.0 type checker Area → compiler: Semantic analysis

Comments

@AnthonyLatsis
Copy link
Collaborator

Description

No response

Reproduction

func foo<T>(_: T, _: T) -> [T] {}

func test() {
  let int: Int
  let int16: Int16
  for _ in foo(int16, int) {}
}
error: conflicting arguments to generic parameter 'Self' ('[Int16]' vs. '[Int]') [conflicting_arguments_for_generic_parameter]
  for _ in foo(int16, int) {}
                         ^
error: conflicting arguments to generic parameter 'T' ('Int16' vs. 'Int') [conflicting_arguments_for_generic_parameter]
  for _ in foo(int16, int) {}
           ^
error: conflicting arguments to generic parameter 'Elements' ('[Int16]' vs. '[Int]') [conflicting_arguments_for_generic_parameter]
  for _ in foo(int16, int) {}
  ^

Expected behavior

A single error in relation to written code: conflicting arguments to generic parameter 'T' ('Int16' vs. 'Int').

Environment

Swift version 6.0-dev (LLVM 48dc0c6fa01ce9e, Swift 2650c285671c227)

Additional information

No response

@AnthonyLatsis AnthonyLatsis added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis generics Feature: generic declarations and types for-in loops Feature: for-in loops statements Feature: statements swift 6.0 labels Apr 3, 2024
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 diagnostics QoI Bug: Diagnostics Quality of Implementation for-in loops Feature: for-in loops generics Feature: generic declarations and types statements Feature: statements swift 6.0 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

1 participant