Skip to content

Commit

Permalink
v2.2.8
Browse files Browse the repository at this point in the history
- Fix issue with parameter resolution when calling a constructor/method.

- analyzer: ^6.4.1
- mime: ^1.0.5
- build_runner: ^2.4.8
- test: ^1.25.2
  • Loading branch information
gmpassos committed Jan 31, 2024
1 parent 8d21dcc commit 5cbc9a2
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 20 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 2.2.8

- Fix issue with parameter resolution when calling a constructor/method.

- analyzer: ^6.4.1
- mime: ^1.0.5
- build_runner: ^2.4.8
- test: ^1.25.2

## 2.2.7

- Small fix for `Duration` support.
Expand Down
4 changes: 2 additions & 2 deletions example/reflection_factory_bridge_example.reflection.g.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// GENERATED CODE - DO NOT MODIFY BY HAND!
// BUILDER: reflection_factory/2.2.7
// BUILDER: reflection_factory/2.2.8
// BUILD COMMAND: dart run build_runner build
//

Expand All @@ -20,7 +20,7 @@ typedef __TI<T> = TypeInfo<T>;
typedef __PR = ParameterReflection;

mixin __ReflectionMixin {
static final Version _version = Version.parse('2.2.7');
static final Version _version = Version.parse('2.2.8');

Version get reflectionFactoryVersion => _version;

Expand Down
4 changes: 2 additions & 2 deletions example/reflection_factory_example.reflection.g.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// GENERATED CODE - DO NOT MODIFY BY HAND!
// BUILDER: reflection_factory/2.2.7
// BUILDER: reflection_factory/2.2.8
// BUILD COMMAND: dart run build_runner build
//

Expand All @@ -20,7 +20,7 @@ typedef __TI<T> = TypeInfo<T>;
typedef __PR = ParameterReflection;

mixin __ReflectionMixin {
static final Version _version = Version.parse('2.2.7');
static final Version _version = Version.parse('2.2.8');

Version get reflectionFactoryVersion => _version;

Expand Down
31 changes: 24 additions & 7 deletions lib/src/reflection_factory_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import 'reflection_factory_utils.dart';
/// Class with all registered reflections ([ClassReflection]).
class ReflectionFactory {
// ignore: constant_identifier_names
static const String VERSION = '2.2.7';
static const String VERSION = '2.2.8';

static final ReflectionFactory _instance = ReflectionFactory._();

Expand Down Expand Up @@ -3105,14 +3105,31 @@ class _ParameterResolver {
Map<String, dynamic>.fromEntries(
parameters.values.mapIndexed(_resolveNamed));

_ParameterValueEntry _resolveNormal(int i, ParameterReflection p) =>
_ParameterValueEntry(p.name, parameterProvider(p, i));
_ParameterValueEntry _resolveNormal(int i, ParameterReflection p) {
try {
return _ParameterValueEntry(p.name, parameterProvider(p, i));
} on TypeError {
return _ParameterValueEntry(p.name, unresolvedParameterValue);
}
}

_ParameterValueEntry _resolveOptional(int i, ParameterReflection p) =>
_ParameterValueEntry(p.name, parameterProvider(p, offsetOptional + i));
_ParameterValueEntry _resolveOptional(int i, ParameterReflection p) {
try {
return _ParameterValueEntry(
p.name, parameterProvider(p, offsetOptional + i));
} on TypeError {
return _ParameterValueEntry(p.name, unresolvedParameterValue);
}
}

_ParameterValueEntry _resolveNamed(int i, ParameterReflection p) =>
_ParameterValueEntry(p.name, parameterProvider(p, offsetNamed + i));
_ParameterValueEntry _resolveNamed(int i, ParameterReflection p) {
try {
return _ParameterValueEntry(
p.name, parameterProvider(p, offsetNamed + i));
} on TypeError {
return _ParameterValueEntry(p.name, unresolvedParameterValue);
}
}
}

/// Base class fro methods and constructors.
Expand Down
10 changes: 5 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: reflection_factory
description: Allows Dart reflection with an easy approach, even for third-party classes, using code generation portable for all Dart platforms.
version: 2.2.7
version: 2.2.8
homepage: https://github.com/gmpassos/reflection_factory

environment:
sdk: '>=3.0.0 <4.0.0'

dependencies:
build: ^2.4.1
analyzer: ^6.2.0
analyzer: ^6.4.1
dart_style: ^2.3.4
meta: ^1.9.1
mime: ^1.0.4
mime: ^1.0.5
base_codecs: ^1.0.1
pub_semver: ^2.1.4
path: ^1.8.3
Expand All @@ -20,12 +20,12 @@ dependencies:
source_span: ^1.10.0

dev_dependencies:
build_runner: ^2.4.7
build_runner: ^2.4.8
build_test: ^2.2.2
lints: ^3.0.0
pubspec: ^2.3.0
data_serializer: ^1.0.12
dependency_validator: ^3.2.2
test: ^1.24.9
test: ^1.25.2
coverage: ^1.7.2
benchmark: ^0.3.0
4 changes: 2 additions & 2 deletions test/src/reflection/user_with_reflection.g.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// GENERATED CODE - DO NOT MODIFY BY HAND!
// BUILDER: reflection_factory/2.2.7
// BUILDER: reflection_factory/2.2.8
// BUILD COMMAND: dart run build_runner build
//

Expand All @@ -20,7 +20,7 @@ typedef __TI<T> = TypeInfo<T>;
typedef __PR = ParameterReflection;

mixin __ReflectionMixin {
static final Version _version = Version.parse('2.2.7');
static final Version _version = Version.parse('2.2.8');

Version get reflectionFactoryVersion => _version;

Expand Down
4 changes: 2 additions & 2 deletions test/src/user_reflection_bridge.reflection.g.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// GENERATED CODE - DO NOT MODIFY BY HAND!
// BUILDER: reflection_factory/2.2.7
// BUILDER: reflection_factory/2.2.8
// BUILD COMMAND: dart run build_runner build
//

Expand All @@ -20,7 +20,7 @@ typedef __TI<T> = TypeInfo<T>;
typedef __PR = ParameterReflection;

mixin __ReflectionMixin {
static final Version _version = Version.parse('2.2.7');
static final Version _version = Version.parse('2.2.8');

Version get reflectionFactoryVersion => _version;

Expand Down

0 comments on commit 5cbc9a2

Please sign in to comment.