cooler-king / quantity

A package to make it easy to work with physical quantities.
MIT License
19 stars 4 forks source link

WARNING: Problem creating type instance; falling back to MiscQuantity for Dimensions [Length=-2] #44

Open syroezhkin opened 1 week ago

syroezhkin commented 1 week ago

Hello! I'm trying to do a simple physical quantity conversion operation. The result is correct, but it outputs a warning to the console. What does this warning mean and how can I get rid of it?

import 'package:quantity/quantity_si.dart';

var area = Area(m2: 1);
var force = Force(N: 10);

var pressure = force / area; // => WARNING: Problem creating type instance; falling back to MiscQuantity for Dimensions [Length=-2]
print(pressure); // => 10 Pa
cooler-king commented 1 day ago

This happens due to an intermediate calculation (inversion of the area to a quantity with dimensions of length:-2). It can be safely ignored.

The next release will push this logger down to finest level.