1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

compiler: error on unused imports

This commit is contained in:
joe-conigliaro
2019-09-23 20:42:20 +10:00
committed by Alexander Medvednikov
parent 71484e89d6
commit 23c84516e2
29 changed files with 112 additions and 55 deletions

View File

@@ -1,5 +1,3 @@
import os
const (
q = [1, 2, 3]
A = 8

View File

@@ -1,4 +1,4 @@
import time
// import time
struct User {
name string

View File

@@ -8,7 +8,6 @@
module aes
import (
crypto.cipher
crypto.internal.subtle
)

View File

@@ -31,7 +31,7 @@ fn _new_cbc(b AesCipher, iv []byte) AesCbc {
b: b,
block_size: b.block_size(),
iv: iv.clone(),
tmp: [byte(0); b.block_size()],
tmp: [byte(0)].repeat(b.block_size()),
}
}

View File

@@ -5,8 +5,8 @@
module aes
import (
crypto.cipher
crypto.internal.subtle
// crypto.cipher
// crypto.internal.subtle
)
// new_cipher_generic creates and returns a new cipher.Block

View File

@@ -8,7 +8,6 @@ import (
os
gx
gg
stbi
glm
gl
)

View File

@@ -4,7 +4,7 @@
module gl
import os
// import os
import gx
import glm

View File

@@ -8,6 +8,9 @@ module gl
#include "glad.h"
#flag @VROOT/thirdparty/glad/glad.o
// joe-c: fix & remove
enum TmpGlImportHack{}
pub fn init_glad() {
ok := C.gladLoadGL()
if isnil(ok) {

View File

@@ -4,6 +4,8 @@
module glfw
// note: we might need special case for this
// see TmpGlImportHack below (joe-c)
import gl
#flag -I @VROOT/thirdparty/glfw
@@ -41,6 +43,11 @@ const (
KeyDown = 264
)
// joe-c: fix & remove
struct TmpGlImportHack {
hack gl.TmpGlImportHack
}
struct WinCfg {
width int
height int

View File

@@ -2,8 +2,8 @@
// Use of this source code is governed by an MIT license
// that can be found in the LICENSE file.
import os
import gl
// might need special case for this
// import gl
import glm
fn cmp(a, b f32) bool {

View File

@@ -4,8 +4,6 @@
module http
import os
type downloadfn fn (written int)
type download_finished_fn fn ()

View File

@@ -1,5 +1,5 @@
import net.urllib
import http
// import net.urllib
// import http
fn test_escape_unescape() {
/*

View File

@@ -4,7 +4,8 @@
module stbi
import gl
// note we might need special case for this
// import gl
#flag -I @VROOT/thirdparty/stb_image

View File

@@ -3,7 +3,6 @@
// that can be found in the LICENSE file.
module sync
import os
// Mutex HANDLE
type MHANDLE voidptr

View File

@@ -4,8 +4,6 @@
module term
import os
fn _format(msg, open, close string) string {
return '\x1b[' + open + 'm' + msg + '\x1b[' + close + 'm'
}

View File

@@ -4,8 +4,6 @@
module term
import os
pub fn format(msg, open, close string) string {
return _format(msg, open, close)
}

View File

@@ -2,7 +2,6 @@ module vweb
import (
os
strings
net
http
net.urllib