Skip to content

Spelling interop #42549

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

Merged
merged 10 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import MemberwiseInitializer

let structPrivateOnly = StructPrivateOnly(varPrivate: 42) // expected-error {{argument passed to call that takes no arguments}}
let structPublicOnly = StructPublicOnly(varPublic: 42)
let structEmptyPrivateSetion = StructEmptyPrivateSection(varPublic: 42)
let structEmptyPrivateSection = StructEmptyPrivateSection(varPublic: 42)
let structPublicAndPrivate1 = StructPublicAndPrivate(varPublic: 42) // expected-error {{argument passed to call that takes no arguments}}
let structPublicAndPrivate2 = StructPublicAndPrivate(varPublic: 42, varPrivate: 23) // expected-error {{argument passed to call that takes no arguments}}
let structWithUnimportedMemberFunction = StructWithUnimportedMemberFunction(varPublic: 42)

let classPrivateOnly = ClassPrivateOnly(varPrivate: 42) // expected-error {{argument passed to call that takes no arguments}}
let classPublicOnly = ClassPublicOnly(varPublic: 42)
let classEmptyPublicSetion = ClassEmptyPublicSection(varPrivate: 42) // expected-error {{argument passed to call that takes no arguments}}
let classEmptyPublicSection = ClassEmptyPublicSection(varPrivate: 42) // expected-error {{argument passed to call that takes no arguments}}
let classPublicAndPrivate1 = ClassPrivateAndPublic(varPublic: 23) // expected-error {{argument passed to call that takes no arguments}}
let classPublicAndPrivate2 = ClassPrivateAndPublic(varPrivate: 42, varPublic: 23) // expected-error {{argument passed to call that takes no arguments}}
let classWithUnimportedMemberFunction = ClassWithUnimportedMemberFunction(varPublic: 42)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %target-swiftxx-frontend -I %S/Inputs %s -emit-ir | %FileCheck %s

// Verify that non-trival/address-only C++ classes are constructed and accessed
// Verify that non-trivial/address-only C++ classes are constructed and accessed
// correctly. Make sure that we correctly IRGen functions that construct
// non-trivial C++ classes, take those classes as a parameter, and access those
// classes members.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ template <class T>
void functionTemplateWithDefaultedParam(T = 0) {}

template <class T = void>
void defaultedTemplateTypeParamUsedInSignatureAndUnrealtedParam(int, T) {}
void defaultedTemplateTypeParamUsedInSignatureAndUnrelatedParam(int, T) {}

template <class = void>
void defaultedTemplateTypeParamAndUnrealtedParam(int) {}
void defaultedTemplateTypeParamAndUnrelatedParam(int) {}

template <class T = int>
void overloadedDefaultedTemplate(T) {}
Expand Down
2 changes: 1 addition & 1 deletion test/Interop/Cxx/templates/Inputs/function-templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ template <class R, class T, class U> R templateParameterReturnType(T a, U b) {
// Same here:
template <class T> void cannotInferTemplate() {}

struct HasVariadicMemeber {
struct HasVariadicMember {
void test1(...) {}
void test2(int, ...) {}
};
Expand Down
2 changes: 1 addition & 1 deletion test/Interop/Cxx/templates/Inputs/module.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module ExplicitClassSpecialization {
requires cplusplus
}

module ClassTemplateInstantionExistingSpecialization {
module ClassTemplateInstantiationExistingSpecialization {
header "class-template-instantiation-existing-specialization.h"
requires cplusplus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// REQUIRES: executable_test

// Please don't add tests into this test case - its setup is quite delicate.
import ClassTemplateInstantionExistingSpecialization
import ClassTemplateInstantiationExistingSpecialization
import StdlibUnittest

var TemplatesTestSuite = TestSuite("TemplatesTestSuite")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
// CHECK: func defaultedTemplateTypeParamUsedInReturn<T>() -> T
// CHECK: func defaultedTemplateTypeParamAndDefaultedParam<T>(_: T)
// CHECK: func functionTemplateWithDefaultedParam<T>(_: T)
// CHECK: func defaultedTemplateTypeParamUsedInSignatureAndUnrealtedParam<T>(_: Int32, _: T)
// CHECK: func defaultedTemplateTypeParamAndUnrealtedParam(_: Int32)
// CHECK: func defaultedTemplateTypeParamUsedInSignatureAndUnrelatedParam<T>(_: Int32, _: T)
// CHECK: func defaultedTemplateTypeParamAndUnrelatedParam(_: Int32)
// CHECK: func overloadedDefaultedTemplate<T>(_: T)
// CHECK: func overloadedDefaultedTemplate(_: Int32)
// CHECK: func defaultedTemplateReferenceTypeParam<T>(_ t: inout T)
// The following types aren't imported correctly, but that does not have to do
// with the fact that the template type paramaters are defaulted.
// with the fact that the template type parameters are defaulted.
// TODO: reenable the following checks: (rdar://90587703)
// TODO-CHECK: func defaultedTemplatePointerTypeParam<T>(_ t: UnsafeMutablePointer<T>)
// TODO-CHECK: func defaultedTemplatePointerPointerTypeParam<T>(_ t: UnsafeMutablePointer<OpaquePointer?>!)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ DefaultedTemplateTestSuite.test("Function with defaulted template type parameter
let _: Int = defaultedTemplateTypeParamUsedInReturn()
defaultedTemplateTypeParamAndDefaultedParam(0)
functionTemplateWithDefaultedParam(0)
defaultedTemplateTypeParamUsedInSignatureAndUnrealtedParam(0, 0)
defaultedTemplateTypeParamAndUnrealtedParam(0)
defaultedTemplateTypeParamUsedInSignatureAndUnrelatedParam(0, 0)
defaultedTemplateTypeParamAndUnrelatedParam(0)
}

DefaultedTemplateTestSuite.test("Overloaded function template is not ambiguous") {
Expand Down
2 changes: 1 addition & 1 deletion test/Interop/Cxx/templates/dependent-types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ DependentTypesTestSuite.test("Different dependent inferred by arg.") {
expectEqual(m.getValue(), 42)
}

DependentTypesTestSuite.test("Instanciate the same function twice") {
DependentTypesTestSuite.test("Instantiate the same function twice") {
// Intentionally test the same thing twice.
let m = dependantReturnTypeInffered(42) as! M<Int>
expectEqual(m.getValue(), 42)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// CHECK: func templateParameterReturnType<R, T, U>(_ a: T, _ b: U) -> R
// CHECK: func cannotInferTemplate<T>(T: T.Type)

// CHECK: struct HasVariadicMemeber {
// CHECK: struct HasVariadicMember {
// CHECK: @available(*, unavailable, message: "Variadic function is unavailable")
// CHECK: mutating func test1(_ varargs: Any...)
// CHECK: @available(*, unavailable, message: "Variadic function is unavailable")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %target-swiftxx-frontend -emit-module -o %t/SwiftClassTemplateInNamespaceModule.swiftmodule %S/Inputs/SwiftClassTemplateInNamespaceModule.swift -I %S/Inputs -enable-library-evolution -swift-version 5
// RUN: %target-swift-ide-test -print-module -module-to-print=SwiftClassTemplateInNamespaceModule -I %t/ -source-filename=x -enable-experimental-cxx-interop | %FileCheck %s

// The following bug needs to be resolved so decls in __ObjC don't dissapear.
// The following bug needs to be resolved so decls in __ObjC don't disappear.
// REQUIRES: SR-14211

// CHECK: import ClassTemplateInNamespaceForSwiftModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ TemplateNotInSignatureTestSuite.test("Function with defaulted template type para
expectEqual(y, 10)
}

TemplateNotInSignatureTestSuite.test("Instanciate the same function template twice.") {
TemplateNotInSignatureTestSuite.test("Instantiate the same function template twice.") {
// Intentionally test the same thing twice.
templateTypeParamNotUsedInSignature(T: Int.self)
templateTypeParamNotUsedInSignature(T: Int.self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct HasDefaultedDestructor {
};

// For the following objects with virtual bases / destructors, make sure that
// any exectuable user of these objects disable rtti and exceptions. Otherwise,
// any executable user of these objects disable rtti and exceptions. Otherwise,
// the linker will error because of undefined vtables.
// FIXME: Once we can link with libc++ we can enable RTTI.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This test checks that the compiler uses well-known witness tables for types
// that have the appropriate size/shape (for example, { i8 x 4 } -> i32).

// These witness tables look very differnt on Windows so it doesn't make sense
// These witness tables look very different on Windows so it doesn't make sense
// to test them in the same file.
// XFAIL: OS=windows-msvc

Expand Down