Skip to content
Playground(another site)

bynk.parse.malformed_float_literal

Error A float literal is missing a digit on one side of the . (1., .5).

A Float literal has a digit on each side of the point, as in 1.0 and 0.5; 1. and .5 are refused. This keeps a method call on a number, such as 1.toFloat() or 2.5.round(), unambiguous. Write the missing digit; the note gives the corrected literal.

Example

const Half: Float = .5 // ✗ no digit before the point
const Half: Float = 0.5 // ✓

In the Book

See also

  • The grammar rule it governs: float_literal.
  • Every code in its category, Parser, on the diagnostic index.
  • bynk explain bynk.parse.malformed_float_literal shows the same from the installed toolchain, without a network.