<commit_before>// RUN: %empty-directory(%t)

// RUN: %target-build-swift -emit-executable %s -g -o %t/generic_typealias -emit-module

// RUN: sed -ne '/\/\/ *DEMANGLE-TYPE: /s/\/\/ *DEMANGLE-TYPE: *//p' < %s > %t/input
// RUN: %lldb-moduleimport-test-with-sdk %t/generic_typealias -type-from-mangled=%t/input | %FileCheck %s --check-prefix=CHECK-TYPE

// RUN: sed -ne '/\/\/ *DEMANGLE-DECL: /s/\/\/ *DEMANGLE-DECL: *//p' < %s > %t/input
// RUN: %lldb-moduleimport-test-with-sdk %t/generic_typealias -decl-from-mangled=%t/input | %FileCheck %s --check-prefix=CHECK-DECL

typealias Alias<T> = Int

struct Outer {
  typealias Alias<T> = Int

  struct Inner {
    typealias Alias<T> = Int
  }
}

struct GenericOuter<T> {
  typealias Alias<T> = Int
  typealias AliasWhere = Int where T == GenericOuter<Never>

  struct Inner {
    typealias Alias<T> = Int
    typealias AliasWhere = Int where T: Equatable
  }
}

protocol Proto {
  typealias Alias<T> = Int
}

extension Proto {
  typealias OtherAlias<T> = Int
  typealias OtherAliasWhere = Int where Self == Conforms
}

extension GenericOuter where T : Proto {
  typealias ConditionalAlias<T> = Int
}

struct Conforms : Proto {}

func blackHole(_: Any...) {}

do {
  let x1: Alias<String> = 0
  let x2: Outer.Alias<String> = 0
  let x3: Outer.Inner.Alias<String> = 0

  blackHole(x1, x2, x3)
}

do {
  let x1: GenericOuter<Int>.Alias<String> = 0
  let x2: GenericOuter<Int>.Inner.Alias<String> = 0

  blackHole(x1, x2)
}

do {
  // FIXME: https://bugs.swift.org/browse/SR-9762
  // let x1: Proto.Alias<String> = 0
  // let x2: Proto.OtherAlias<String> = 0

  let x1: Conforms.Alias<String> = 0
  let x2: Conforms.OtherAlias<String> = 0

  blackHole(x1, x2)
}

func generic<T : Proto>(_: T) {
  let x1: T.Alias<String> = 0
  let x2: T.OtherAlias<String> = 0
<commit_msg>Gardening: Migrate test suite to GH issues: TypeDecoder<commit_after>// RUN: %empty-directory(%t)

// RUN: %target-build-swift -emit-executable %s -g -o %t/generic_typealias -emit-module

// RUN: sed -ne '/\/\/ *DEMANGLE-TYPE: /s/\/\/ *DEMANGLE-TYPE: *//p' < %s > %t/input
// RUN: %lldb-moduleimport-test-with-sdk %t/generic_typealias -type-from-mangled=%t/input | %FileCheck %s --check-prefix=CHECK-TYPE

// RUN: sed -ne '/\/\/ *DEMANGLE-DECL: /s/\/\/ *DEMANGLE-DECL: *//p' < %s > %t/input
// RUN: %lldb-moduleimport-test-with-sdk %t/generic_typealias -decl-from-mangled=%t/input | %FileCheck %s --check-prefix=CHECK-DECL

typealias Alias<T> = Int

struct Outer {
  typealias Alias<T> = Int

  struct Inner {
    typealias Alias<T> = Int
  }
}

struct GenericOuter<T> {
  typealias Alias<T> = Int
  typealias AliasWhere = Int where T == GenericOuter<Never>

  struct Inner {
    typealias Alias<T> = Int
    typealias AliasWhere = Int where T: Equatable
  }
}

protocol Proto {
  typealias Alias<T> = Int
}

extension Proto {
  typealias OtherAlias<T> = Int
  typealias OtherAliasWhere = Int where Self == Conforms
}

extension GenericOuter where T : Proto {
  typealias ConditionalAlias<T> = Int
}

struct Conforms : Proto {}

func blackHole(_: Any...) {}

do {
  let x1: Alias<String> = 0
  let x2: Outer.Alias<String> = 0
  let x3: Outer.Inner.Alias<String> = 0

  blackHole(x1, x2, x3)
}

do {
  let x1: GenericOuter<Int>.Alias<String> = 0
  let x2: GenericOuter<Int>.Inner.Alias<String> = 0

  blackHole(x1, x2)
}

do {
  // FIXME: https://github.com/apple/swift/issues/52190
  // let x1: Proto.Alias<String> = 0
  // let x2: Proto.OtherAlias<String> = 0

  let x1: Conforms.Alias<String> = 0
  let x2: Conforms.OtherAlias<String> = 0

  blackHole(x1, x2)
}

func generic<T : Proto>(_: T) {
  let x1: T.Alias<String> = 0
  let x2: T.OtherAlias<String> = 0

{'fraction_non_alphanumeric': 0.16158868335146898, 'fraction_numerical': 0.01822633297062024, 'mean_word_length': 3.2459584295612007, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2876550', 'n_tokens_mistral': 1534, 'n_tokens_neox': 1470, 'n_words': 343}