Merge pull request #614 from owen-mc/always-extract-empty-interface-type

Always extract empty interface type
This commit is contained in:
Chris Smowton
2021-11-29 12:15:52 +00:00
committed by GitHub
4 changed files with 17 additions and 0 deletions

View File

@@ -352,6 +352,9 @@ func extractUniverseScope() {
lbl := tw.Labeler.ScopeID(types.Universe, nil)
dbscheme.ScopesTable.Emit(tw, lbl, dbscheme.UniverseScopeType.Index())
extractObjects(tw, types.Universe, lbl)
// Always extract an empty interface type
extractType(tw, types.NewInterfaceType([]*types.Func{}, []types.Type{}))
}
// extractObjects extracts all objects declared in the given scope

View File

@@ -0,0 +1 @@
| success |

View File

@@ -0,0 +1,9 @@
package main
// This file tests that the extractor does not crash on files that do not
// end in a newline, so it is important not to autoformat this file.
// autoformat-ignore
func main() {
}

View File

@@ -0,0 +1,4 @@
import go
where exists(InterfaceType empty | not empty.hasMethod(_, _))
select "success"