Giter Club home page Giter Club logo

Comments (3)

xhd2015 avatar xhd2015 commented on September 24, 2024

The following code from hugoio/hugo also fails to build:

file: https://github.com/gohugoio/hugo/blob/7f3061723e3df064515fc57c183b06ed16f26b75/tpl/math/round.go#L52

package hugoio

const (
	bias  = 1023
	shift = 64 - 11 - 1
)

func round(x float64) {
	var e uint

	if e < bias+shift {
	}
}

Message:

 with-go1.22 xgo test -v --project-dir runtime/test/bugs/hugoio
# github.com/xhd2015/xgo/runtime/test/bugs/hugoio [github.com/xhd2015/xgo/runtime/test/bugs/hugoio.test]
<unknown line number>: internal compiler error: panic: interface conversion: interface {} is string, not syntax.writeError

Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new
FAIL    github.com/xhd2015/xgo/runtime/test/bugs/hugoio [build failed]
exit status 1

The line that causes error: if e < bias+shift {

from xgo.

xhd2015 avatar xhd2015 commented on September 24, 2024

As for the pocketbase, the following code fails to build:
https://github.com/pocketbase/pocketbase/blob/4937acb3e2685273998506b715e2b54e33174172/models/schema/schema_field.go#L591

// see https://github.com/xhd2015/xgo/issues/142
package pocketbase

const DefaultDateLayout = "2006-01-02 15:04:05.000Z"

func chainedConst() {
	// the problem only appears when chained const with
	// following call with arg
	wrap(DefaultDateLayout).Min(nil)
}

func wrap(e string) interface{ Min(t interface{}) } {
	return nil
}
 with-go1.22 go run -tags dev ./cmd/xgo build -v --project-dir runtime/test/bugs/pocketbase
github.com/xhd2015/xgo/runtime/test/bugs/pocketbase
# github.com/xhd2015/xgo/runtime/test/bugs/pocketbase
<unknown line number>: internal compiler error: panic: interface conversion: interface {} is string, not syntax.writeError

Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new

The line that causes error: wrap(DefaultDateLayout).Min(nil)

from xgo.

xhd2015 avatar xhd2015 commented on September 24, 2024

Addressed in #145

from xgo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.