diff --git a/Sources/FrontEnd/TypedProgram.swift b/Sources/FrontEnd/TypedProgram.swift index 69af485ec..75a4dba86 100644 --- a/Sources/FrontEnd/TypedProgram.swift +++ b/Sources/FrontEnd/TypedProgram.swift @@ -290,7 +290,7 @@ public struct TypedProgram { } /// Returns the trait of which `d` is a member, or `nil` if `d` isn't member of a trait. - public func traitDefining(_ d: T) -> TraitType? { + public func traitDeclaring(_ d: T) -> TraitType? { var checker = TypeChecker(asContextFor: self) return checker.traitDefining(d) } @@ -298,7 +298,7 @@ public struct TypedProgram { /// If `d` is member of a trait `c`, returns `(d, c)` if `d` is a requirement, or `(r, c)` if `d` /// is a default implementation of a requirement `r`. Otherwise, returns `nil`. public func requirementDeclaring(_ d: AnyDeclID) -> (decl: AnyDeclID, trait: TraitType)? { - guard let c = traitDefining(d) else { return nil } + guard let c = traitDeclaring(d) else { return nil } // `d` might be the default definition of itself. if isRequirement(d) { return (d, c) } diff --git a/Sources/IR/TypedProgram+Extensions.swift b/Sources/IR/TypedProgram+Extensions.swift index defeb4e8e..67a742eac 100644 --- a/Sources/IR/TypedProgram+Extensions.swift +++ b/Sources/IR/TypedProgram+Extensions.swift @@ -8,7 +8,7 @@ extension TypedProgram { func traitMember(referredBy f: Function.ID) -> (declaration: AnyDeclID, trait: TraitType)? { switch f.value { case .lowered(let d): - guard let t = traitDefining(d) else { return nil } + guard let t = traitDeclaring(d) else { return nil } return (declaration: d, trait: t) default: