-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: do not treat subpackage paths as part of the current package #1530
Conversation
@@ -398,46 +398,46 @@ func TestErrorReporting(t *testing.T) { | |||
filename := filepath.Join(pwd, `testdata/failing/failing.go`) | |||
actual := slices.Map(r.MustGet().Errors, func(e *schema.Error) string { return strings.TrimPrefix(e.Error(), filename+":") }) | |||
expected := []string{ | |||
`10:13-34: first argument to config and secret declarations must be the name as a string literal`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the new import has moved everything down a line...
7cc2796
to
81188b6
Compare
go-runtime/compile/schema_test.go
Outdated
`153:2-2: unsupported type ftl/failing/child.ChildString from subpackage`, | ||
`153:2-8: unsupported type "ftl/failing/child.ChildString" for field "String"`, | ||
`157:1-1: unsupported type ftl/failing/child.ChildStruct from subpackage`, | ||
`157:1-33: unsupported type "struct{Name string}" for type alias`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errors for line 152 onwards are what are actually being surfaced with the new test change
81188b6
to
8602e70
Compare
This wasn't as neat as I'd hoped. Originally I was hoping it'd just be a change to |
go-runtime/compile/schema.go
Outdated
func (p *parseContext) isPathInPkg(path string) bool { | ||
if path == p.pkg.PkgPath { | ||
return true | ||
if strings.Contains(path, "namedext") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debugging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️
# Conflicts: # go-runtime/compile/schema_test.go # go-runtime/compile/testdata/failing/failing.go
# Conflicts: # go-runtime/compile/schema_test.go
81974a3
to
f01b5fa
Compare
fixes #1529