Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix spellos. Also update SPMBuildToolSupport to a spello-less version. #1365

Merged
merged 1 commit into from
Mar 5, 2024
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
4 changes: 2 additions & 2 deletions Docs/GenericEnvironments.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To make sense of a generic signature, the compiler creates a corresponding gener
In essence, a generic environment is a set of axioms that can be used in conjunction with the type system to prove arbitrary formulae about type or value terms.
For example, given the generic signature above, the corresponding environment can be used to prove that `T.Element` has a member `infix+`.

> Note that trait decalrations also describe a generic environment.
> Note that trait declarations also describe a generic environment.
> All traits define an implicit generic parameter denoting `Self` that is bound by the trait they declare.
> Constraints on associated type and values define additional axioms.

Expand Down Expand Up @@ -136,7 +136,7 @@ Here, however, it doesn't because at this point we now that `T.Element.Element`
There is one rule we must add to use this evaluation order: a generic parameters introduced without a bound are assumed type-kinded.
With this assumption, we never have to look at uses of a generic parameter to determine whether it is a type or a value.
For example, this signature is ill-formed: `<T, U where T == Int[U]>`.
Further, note that generic parameters can't be instantiated as traits, so if we see `T: U` we can always conclude that `T` must be a value and that `U` must be a tyoe.
Further, note that generic parameters can't be instantiated as traits, so if we see `T: U` we can always conclude that `T` must be a value and that `U` must be a type.

The next challenge is to deduce the implications of a constraint, given a partially constructed environment.
Before we tackle this one, let's make a few observations:
Expand Down
2 changes: 1 addition & 1 deletion Sources/FrontEnd/Parse/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2205,7 +2205,7 @@ public enum Parser {
) throws -> AnyExprID? {
// There are 4 kinds of expressions starting with a left bracket: arrow types, buffers, maps,
// and captures. We can commit to a capture if the token following the opening bracket is an
// access modifer. Otherwise, we can assume we're parsing an arrow type until the point where
// access modifier. Otherwise, we can assume we're parsing an arrow type until the point where
// we should consume an effect or a right arrow.
let backup = state.backup()

Expand Down
2 changes: 1 addition & 1 deletion Sources/FrontEnd/TypeChecking/RefinementCluster.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct RefinementCluster: Equatable {
/// The refinement relationships in the cluster.
private(set) var refinements: Refinements

/// Creates a cluster contaning only `bottom`.
/// Creates a cluster containing only `bottom`.
init(_ bottom: TraitType) {
self.bottom = bottom
self.unordered = [bottom]
Expand Down
4 changes: 2 additions & 2 deletions Sources/FrontEnd/TypeChecking/TypeChecker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2525,7 +2525,7 @@ struct TypeChecker {
private mutating func uncheckedInputTypes<T: Decl & LexicalScope>(
of ps: [ParameterDecl.ID], declaredBy d: T.ID
) -> [CallableTypeParameter] {
// The generic environement of the declaration is built before we can resolve the types of the
// The generic environment of the declaration is built before we can resolve the types of the
// parameter annotations to avoid infinite recursion in cases the bounds of a generic parameter
// lead name resolution back to environment (e.g., `<T: P>(x: T)` in a trait extension.)
_ = environment(of: AnyScopeID(d))
Expand Down Expand Up @@ -4821,7 +4821,7 @@ struct TypeChecker {
elementHint = ^freshVariable()
}

// If the buffer has no element, we keep the element type open. Othewise, we use the type of
// If the buffer has no element, we keep the element type open. Otherwise, we use the type of
// the first element to constrain all others.
if let elements = program[e].elements.headAndTail {
let head = inferredType(of: elements.head, withHint: elementHint, updating: &obligations)
Expand Down
6 changes: 3 additions & 3 deletions Sources/IR/Emitter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2036,7 +2036,7 @@ struct Emitter {
.autoclosure(e), typed: t, parameterizedBy: h, in: program[e].scope)
let callee = withClearContext({ $0.lower(syntheticAutoclosure: f) })

// Emit the IR code to reference tha function declaration.
// Emit the IR code to reference the function declaration.
let r = FunctionReference(
to: callee, in: module,
specializedBy: module.specialization(in: insertionFunction!), in: insertionScope!)
Expand Down Expand Up @@ -2493,7 +2493,7 @@ struct Emitter {
return x0
}

/// Traps on this execution path becauses of un unexpected coercion from `lhs` to `rhs`.
/// Traps on this execution path because of un unexpected coercion from `lhs` to `rhs`.
private func unexpectedCoercion(
from lhs: AnyType, to rhs: AnyType, file: StaticString = #file, line: UInt = #line
) -> Never {
Expand Down Expand Up @@ -2854,7 +2854,7 @@ struct Emitter {
return
}

// Insert a call to the approriate move implementation if its semantics is unambiguous.
// Insert a call to the appropriate move implementation if its semantics is unambiguous.
// Otherwise, insert a call to the method bundle.
if let k = semantics.uniqueElement {
emitMove(k, value, to: storage, withMovableConformance: movable, at: site)
Expand Down
2 changes: 1 addition & 1 deletion Sources/IR/Module.swift
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ public struct Module {
}
}

/// Returns the IR function implementing the copy oepration defined in `conformanceToCopyable`.
/// Returns the IR function implementing the copy operation defined in `conformanceToCopyable`.
///
/// - Parameter conformanceToCopyable: A conformance to `Copyable`.
mutating func demandCopyDeclaration(
Expand Down
2 changes: 1 addition & 1 deletion StandardLibrary/Sources/Core/Collection.hylo
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public trait Collection {
/// - Requires: `i != end_position()`.
fun position(after i: Position) -> Position

/// Accesses the elment at position `i`.
/// Accesses the element at position `i`.
///
/// - Requires: `i` is a valid position in `self` different from `end_position()`.
subscript(_ i: Position): Element { let }
Expand Down
2 changes: 1 addition & 1 deletion StandardLibrary/Sources/Core/MutableCollection.hylo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// A collection that can be mutated in place.
trait MutableCollection: Collection {

/// Accesses the elment at position `i`.
/// Accesses the element at position `i`.
///
/// - Requires: `i` is a valid position in `self` different from `end_position()`.
subscript(_ i: Position): Element { inout }
Expand Down
Loading