Skip to content
Draft
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
5 changes: 4 additions & 1 deletion Sources/MockoloFramework/Models/ParsedEntity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,15 @@ struct ResolvedEntity {

func model() -> Model {
let metadata = entity.metadata
// Combine protocol-level attributes with member-level attributes
let protocolLevelAttributes = entity.entityNode.attributesDescription.isEmpty ? [] : [entity.entityNode.attributesDescription]
let combinedAttributes = protocolLevelAttributes + attributes
return NominalModel(name: metadata?.nameOverride ?? (key + "Mock"),
namespaces: entity.entityNode.namespaces,
acl: entity.entityNode.accessLevel,
declKindOfMockAnnotatedBaseType: entity.entityNode.declKind,
declKind: inheritsActorProtocol ? .actor : .class,
attributes: attributes,
attributes: combinedAttributes,
offset: entity.entityNode.offset,
inheritedTypeName: (entity.metadata?.module?.withDot ?? "") + key,
genericWhereConstraints: entity.entityNode.genericWhereConstraints,
Expand Down
3 changes: 3 additions & 0 deletions Tests/TestActor/FixtureActor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
init() { }
}

@MainActor
/// @mockable
@available(iOS 18.0, *)
class P1Mock: P1 {
init() { }
}
Expand Down