You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This release contains all upstream changes from 2023.2.2-rc, plus the following.
Improved
A new property IDeclaration.Sources expose references to the source code. You can now get the file path, line, and column of any declaration.
New overload IMethod.Invoke( IEnumerable<IExpression> ) to generate dynamic method calls.
Invoking a method from the target type with InvokerOptions.Base and an instance (other than base) is now possible if the base layer is in the current type.
The debugging experience of templates and compile-time code has been greatly improved. However, it is still required to use Debugger.Break() or meta.DebugBreak() to add an initial breakpoint.
Any aspect can now reflect on any other aspect instance (IAspectInstance) added prior to the current aspect thanks to the new API declaration.Enhancements().GetAspectInstances() returning an IEnumerable<IAspectInstance>. The previous method, GetAspect<T>, did not return the IAspectInstance and therefore gave no access to the IAspectState.
The design-time performance of reference validators has been improved.
In the error list, with most errors and warnings reported by aspects, you can now see which aspect class and target declaration reported the diagnostic.
Breaking changes
There will be a few minor breaking changes in 2023.3. We think that there are still relatively few users and certainly little legacy code to maintain compatibility with, so we are prioritizing usability improvements over backward compatibility.
T#: foreach and while expressions now give preference to run-time scope.
Previously, while ( true ) would be interpreted as a compile-time loop. Now, it will be considered as a run-time loop.
Previously, the way to get a compile-time for loop was to do a foreach ( var in in Enumerable.Range(...) ). Now, Enumerable.Range(...) will be interpreted as run-time by default because it is inside a foreach, so you need to specifically mark it as compile-time using foreach ( var in in meta.CompileTime( Enumerable.Range(...) ) ).
In EligibilityExtension, the method void MustSatisfy<T>( this IEligibilityBuilder<T> eligibilityBuilder, Action<IEligibilityBuilder<T>> requirement ) has been renamed to AddRule in order to avoid ambiguities with the first and principal overload of MustSatisfy.
The IDiagnosticSink interface is now internal. The meta.Diagnostics property is now of type ScopedDiagnosticSink. The difference between ScopedDiagnosticSink and IDiagnosticSink is that ScopedDiagnosticSink contains a default target declaration for diagnostics and suppressions.
The type SyntaxReference has been renamed SourceReference.
Fixed
T#
Fixed: can't access local function parameter whose type is compile-time template type parameter.
Fixed: static local functions don't work in compile-time code.
Fixed: Error for iterator local function inside non-iterator template.
Metalama.Extensions.Architecture and reference validators:
Fixed: InternalsMustNotBeUsedFrom and InternalsMustBeUsedFrom report false positives with internal protected members
Fixed: Type references in generic arguments are not visited by reference validators and are ignored from architecture rules.
Fixed: code was not validated when the inner method body was modified, only when declarations were modified.
Fixed: reference validators were not executed across projects at design time.
Fixed: when DerivedTypesMustRespectNamingConvention constraint is applied to T, it also matched derived from OtherType<T>.
Fixed: DerivedTypesMustRespectNamingConvention did not work on indirect type inheritance but only with the first level of inheritance.
Fixed: naming convention warning reported on base type reference instead of on declared type name.
Fixed: InternalsMustNotBeUsedFrom and InternalsMustNotUsedFrom ignored internal setters of public properties.
Eligibility
Fixed: EligibilityExtensions.MustBe throws NotSupportedException when the required type is run-time-only.
Fixed: `EligibilityExtensions.If`` does not fail when the condition is not met.
Misc
Fixed: AssertionFailedException in syntax coloring when processing incomplete ParenthesizedExpression.
Fixed: FileNotFoundException when a test that has a dependency references this dependency in its Main method
Fixed a case of incorrect code generation when return is followed by a statement.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This release contains all upstream changes from 2023.2.2-rc, plus the following.
Improved
IDeclaration.Sources
expose references to the source code. You can now get the file path, line, and column of any declaration.IMethod.Invoke( IEnumerable<IExpression> )
to generate dynamic method calls.InvokerOptions.Base
and an instance (other thanbase
) is now possible if the base layer is in the current type.Debugger.Break()
ormeta.DebugBreak()
to add an initial breakpoint.IAspectInstance
) added prior to the current aspect thanks to the new APIdeclaration.Enhancements().GetAspectInstances()
returning anIEnumerable<IAspectInstance>
. The previous method,GetAspect<T>
, did not return theIAspectInstance
and therefore gave no access to theIAspectState
.Breaking changes
There will be a few minor breaking changes in 2023.3. We think that there are still relatively few users and certainly little legacy code to maintain compatibility with, so we are prioritizing usability improvements over backward compatibility.
T#:
foreach
andwhile
expressions now give preference to run-time scope.Previously,
while ( true )
would be interpreted as a compile-time loop. Now, it will be considered as a run-time loop.Previously, the way to get a compile-time
for
loop was to do aforeach ( var in in Enumerable.Range(...) )
. Now,Enumerable.Range(...)
will be interpreted as run-time by default because it is inside aforeach
, so you need to specifically mark it as compile-time usingforeach ( var in in meta.CompileTime( Enumerable.Range(...) ) )
.In
EligibilityExtension
, the methodvoid MustSatisfy<T>( this IEligibilityBuilder<T> eligibilityBuilder, Action<IEligibilityBuilder<T>> requirement )
has been renamed toAddRule
in order to avoid ambiguities with the first and principal overload ofMustSatisfy
.The
IDiagnosticSink
interface is now internal. Themeta.Diagnostics
property is now of typeScopedDiagnosticSink
. The difference betweenScopedDiagnosticSink
andIDiagnosticSink
is thatScopedDiagnosticSink
contains a default target declaration for diagnostics and suppressions.The type
SyntaxReference
has been renamedSourceReference
.Fixed
T#
Metalama.Extensions.Architecture and reference validators:
InternalsMustNotBeUsedFrom
andInternalsMustBeUsedFrom
report false positives withinternal protected
membersDerivedTypesMustRespectNamingConvention
constraint is applied toT
, it also matched derived fromOtherType<T>
.DerivedTypesMustRespectNamingConvention
did not work on indirect type inheritance but only with the first level of inheritance.InternalsMustNotBeUsedFrom
andInternalsMustNotUsedFrom
ignored internal setters of public properties.Eligibility
EligibilityExtensions.MustBe
throwsNotSupportedException
when the required type is run-time-only.Misc
ParenthesizedExpression
.return
is followed by a statement.Beta Was this translation helpful? Give feedback.
All reactions