Skip to content

mismatched types untyped float and untyped float64 #1694

@pjebs

Description

@pjebs

The following program sample.go triggers an unexpected result

i := interp.New(interp.Options{})
i.Use(stdlib.Symbols)

i.Eval(`package main`)
i.Eval(`import "math"`)
qqq, eee := i.Eval(`math.Sin(0.6 * math.Pi) + 3`)

Expected result

3.9510565162951536

See: https://go.dev/play/p/h0Tv_zUj0H7

Got

mismatched types untyped float and untyped float64

`math.Pi` is defined as a untyped float in the standard library


const (
	Pi  = 3.14159265358979323846264338327950288419716939937510582097494459
)

Yaegi Version

v0.16.1

Additional Notes

https://go.dev/play/p/h0Tv_zUj0H7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions