Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kyouko-taiga committed Sep 28, 2023
1 parent 494b46e commit 2e4937a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/FrontEnd/TypeChecking/TypeChecker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3670,18 +3670,18 @@ struct TypeChecker {

switch program[e].direction {
case .down:
// Note: constraining the type of the left operand to be above the right operand wouldn't
// contribute any useful information to the constraint system.
// Note: constraining the type of the LHS to be above the RHS wouldn't contribute any useful
// information to the constraint system.
_ = inferredType(of: program[e].left, updating: &obligations)

case .up:
// The type of the left operand must be statically known to subtype of the right operand.
// The type of thr LHS must be statically known to subtype of the RHS.
let lhs = inferredType(
of: program[e].left, withHint: ^freshVariable(), updating: &obligations)
obligations.insert(SubtypingConstraint(lhs, rhs.shape, origin: cause))

case .pointerConversion:
// The left operand must be a `Builtin.ptr`. The right operand must be a remote type.
// The LHS be a `Builtin.ptr`. The RHS must be a remote type.
if !(rhs.shape.base is RemoteType) {
report(.error(invalidPointerConversionAt: program[e].right.site))
return constrain(e, to: .error, in: &obligations)
Expand Down

0 comments on commit 2e4937a

Please sign in to comment.