commit | 186cd62d03fabd600745f65e88df084dcab003d7 | [log] [tgz] |
---|---|---|
author | Googler <jcater@google.com> | Thu Mar 28 12:33:36 2024 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Thu Mar 28 12:35:18 2024 -0700 |
tree | 09ab9bc9b5346e8476cfb1b1c504e792e7ad05e4 | |
parent | 87b53ab927f9a8e4b88b7fea00df5d21d28b42be [diff] |
Allow aspects to get the value of implicit attributes. PiperOrigin-RevId: 620022915 Change-Id: I8b129ab84f0348421347677e0aaa7827994b2850
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapper.java b/src/main/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapper.java index badca6d..95a4cf6 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapper.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapper.java
@@ -71,6 +71,8 @@ throw new IllegalArgumentException(String.format( "attribute %s has type %s, not expected type %s", attributeName, attribute.getType(), type)); + } else if (attribute.isImplicit()) { + return type.cast(attribute.getDefaultValue(/* rule= */ null)); } else { throw new UnsupportedOperationException( String.format(