Freezed: [0.10.0] Stack Overflow error for recursive data structures (i.e. tree nodes)

Created on 18 Mar 2020  路  1Comment  路  Source: rrousselGit/freezed

Using freezed 0.10.0 and build_runner 1.8.0

The following code will cause crash during code generation in 0.10.0. However it was fine on 0.9.2.

import 'package:freezed_annotation/freezed_annotation.dart';
part 'main.freezed.dart';

@freezed
abstract class TreeNode with _$TreeNode {
  TreeNode._();
  factory TreeNode({
    TreeNode parent
  }) = _TreeNode;
}

Output is

[INFO] Running build...
[SEVERE] freezed:freezed on bin/main.dart:
Error running FreezedGenerator
Stack Overflow
[INFO] Running build completed, took 1.7s
bug

Most helpful comment

Oopsy, I forgot to handle that case.

Thanks for the report. I will fix it asap

>All comments

Oopsy, I forgot to handle that case.

Thanks for the report. I will fix it asap

Was this page helpful?
0 / 5 - 0 ratings