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
We have just released Metalama 2024.2.4-preview, including all changes from 2024.2.3-preview and 2024.1.17 plus the following:
New
Added support for lambda statements and anonymous methods of known scope, i.e. either run-time or compile-time (the scope can be coerced using meta.RunTime or meta.CompileTime when it is not obvious from the context). Lambda expressions returning dynamic are not supported and won't be. Single-statement lambdas (e.g. () => { return 0; } are transparently simplified into expression lambdas (e.g. () => 0).
New class Promise<T> and interfaces IPromise<T> and IPromise to represent results that are not available yet. This mechanism allows resolving chicken-or-egg issues when introducing members when a template must receive a reference to a declaration that has not been introduced yet. A Promise<T> can be passed as an argument to a template, which receives it on a parameter of type T.
New method IMethodInvoker.CreateInvokeExpression generating an IExpression that represents a method invocation. It can be called outside of a template context.
Updated
Metalama.Patterns.Observability, containing an [Observable] aspect implementing INotifyPropertyChanged has been refactor and is now in almost final state.
Improved in code formatting
Where applicable, redundancies in member access expressions are eliminated (e.g., this.X or MyType.Y becomes X or Y).
Non-extension calls to extension methods in templates are transformed into extension calls. This is useful because extension methods cannot be called on dynamic types. For instance, the C# code LoggerExtensions.LogInformation( meta.This._logger, "Hello" ) would compile to _logger.LogInformation( "Hello" ).
The discard parameter _, when used in templates, is no longer renamed to __1, __2 and so on.
The performance of whole-project output code formatting has been improved. Note that code formatting is disabled by default so it should not affect your standard builds, but LamaDebug builds should be faster.
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
-
We have just released Metalama 2024.2.4-preview, including all changes from 2024.2.3-preview and 2024.1.17 plus the following:
New
meta.RunTime
ormeta.CompileTime
when it is not obvious from the context). Lambda expressions returningdynamic
are not supported and won't be. Single-statement lambdas (e.g.() => { return 0; }
are transparently simplified into expression lambdas (e.g.() => 0
).Promise<T>
and interfacesIPromise<T>
andIPromise
to represent results that are not available yet. This mechanism allows resolving chicken-or-egg issues when introducing members when a template must receive a reference to a declaration that has not been introduced yet. APromise<T>
can be passed as an argument to a template, which receives it on a parameter of typeT
.IMethodInvoker.CreateInvokeExpression
generating anIExpression
that represents a method invocation. It can be called outside of a template context.Updated
Metalama.Patterns.Observability
, containing an[Observable]
aspect implementingINotifyPropertyChanged
has been refactor and is now in almost final state.Improved in code formatting
this.X
orMyType.Y
becomesX
orY
).LoggerExtensions.LogInformation( meta.This._logger, "Hello" )
would compile to_logger.LogInformation( "Hello" )
._
, when used in templates, is no longer renamed to__1
,__2
and so on.LamaDebug
builds should be faster.Beta Was this translation helpful? Give feedback.
All reactions