Skip to content

Commit

Permalink
Merge pull request #68 from brandhuf/architecturebuild-errors-fix
Browse files Browse the repository at this point in the history
fix that dependencies to attributes from unresolvable assemblies resulted in a build error while building the architecture (#51)
  • Loading branch information
fgather authored Mar 24, 2021
2 parents ab6b890 + b35b8ca commit f0c8ceb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ArchUnitNET/Domain/Attribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace ArchUnitNET.Domain
{
public class Attribute : Class
{
public Attribute(IType type, bool isAbstract, bool isSealed) : base(type, isAbstract,
public Attribute(IType type, bool? isAbstract, bool? isSealed) : base(type, isAbstract,
isSealed, false, false)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,13 @@ private IEnumerable<TypeInstance<Attribute>> CreateAttributesFromCustomAttribute
{
var attributeTypeReference = customAttribute.AttributeType;
var attributeType = _typeFactory.GetOrCreateStubTypeInstanceFromTypeReference(attributeTypeReference);
return new TypeInstance<Attribute>(new Attribute(attributeType.Type as Class),
if (attributeType.Type is Class cls)
{
return new TypeInstance<Attribute>(new Attribute(cls),
attributeType.GenericArguments, attributeType.ArrayDimensions);
}

return new TypeInstance<Attribute>(new Attribute(attributeType.Type, null, null),
attributeType.GenericArguments, attributeType.ArrayDimensions);
});
}
Expand Down

0 comments on commit f0c8ceb

Please sign in to comment.