Skip to content

generateJson not compatible with const constructors #6

@befora

Description

@befora

Example to recreate issue:

import 'package:morphy_annotation/morphy_annotation.dart';

part 'pet.g.dart';
part 'pet.morphy.dart';

@Morphy(generateJson: true)
abstract class $Pet {
  const $Pet();
  String get type;
}

I get this error:

Error: Non-constant map literal is not a constant expression.
  Map<Type, Object? Function(Never)> _fns = {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions