Баг?
От: Terre Россия http://terre.h15.ru
Дата: 26.06.07 00:14
Оценка:
Такой код прекрасно компилируется:
def plus = _ + _;
mutable a:int = plus(1,2);
MessageBox.Show(plus(2,4).ToString());
Стоит закомментировать mutable a:int = plus(1,2);, как компилироватья перестает.
Это я нуб или баг такой?

P.S: Build 7711, VS 2005 SP1.

04.07.07 06:06: Перенесено модератором из 'Интеграция Nemerle и Visual Studio' — VladD2
Maybe rain,
Maybe snow,
Maybe yes,
Maybe no.
Re: Баг?
От: Mckey Россия  
Дата: 26.06.07 04:06
Оценка:
Здравствуйте, Terre, Вы писали:

T>Такой код прекрасно компилируется:

T> def plus = _ + _;
T> mutable a:int = plus(1,2);
T> MessageBox.Show(plus(2,4).ToString());
T>Стоит закомментировать mutable a:int = plus(1,2);, как компилироватья перестает.
T>Это я нуб или баг такой?

T>P.S: Build 7711, VS 2005 SP1.




У меня все прекрасно работает...
Делай добро и бросай его в воду...
Re[2]: Баг?
От: Terre Россия http://terre.h15.ru
Дата: 26.06.07 12:46
Оценка:
Здравствуйте, Mckey, Вы писали:
M>

M>У меня все прекрасно работает...


Извиняюсь за флуд, но вот ошибка


Error 7 each overload has an error during call: Overload #1, method System.Windows.Forms.MessageBox.Show(text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons, icon : System.Windows.Forms.MessageBoxIcon, defaultButton : System.Windows.Forms.MessageBoxDefaultButton, options : System.Windows.Forms.MessageBoxOptions, displayHelpButton : bool) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * bool), got string: string is not a subtype of (string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * bool) [simple require]. Overload #2, method System.Windows.Forms.MessageBox.Show(text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons, icon : System.Windows.Forms.MessageBoxIcon, defaultButton : System.Windows.Forms.MessageBoxDefaultButton, options : System.Windows.Forms.MessageBoxOptions, helpFilePath : string) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * string), got string: string is not a subtype of (string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * string) [simple require]. Overload #3, method System.Windows.Forms.MessageBox.Show(owner : System.Windows.Forms.IWin32Window, text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons, icon : System.Windows.Forms.MessageBoxIcon, defaultButton : System.Windows.Forms.MessageBoxDefaultButton, options : System.Windows.Forms.MessageBoxOptions, helpFilePath : string) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (System.Windows.Forms.IWin32Window * string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * string), got string: string is not a subtype of (System.Windows.Forms.IWin32Window * string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * string) [simple require]. Overload #4, method System.Windows.Forms.MessageBox.Show(text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons, icon : System.Windows.Forms.MessageBoxIcon, defaultButton : System.Windows.Forms.MessageBoxDefaultButton, options : System.Windows.Forms.MessageBoxOptions, helpFilePath : string, keyword : string) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * string * string), got string: string is not a subtype of (string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * string * string) [simple require]. Overload #5, method System.Windows.Forms.MessageBox.Show(owner : System.Windows.Forms.IWin32Window, text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons, icon : System.Windows.Forms.MessageBoxIcon, defaultButton : System.Windows.Forms.MessageBoxDefaultButton, options : System.Windows.Forms.MessageBoxOptions, helpFilePath : string, keyword : string) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (System.Windows.Forms.IWin32Window * string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * string * string), got string: string is not a subtype of (System.Windows.Forms.IWin32Window * string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * string * string) [simple require]. Overload #6, method System.Windows.Forms.MessageBox.Show(text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons, icon : System.Windows.Forms.MessageBoxIcon, defaultButton : System.Windows.Forms.MessageBoxDefaultButton, options : System.Windows.Forms.MessageBoxOptions, helpFilePath : string, navigator : System.Windows.Forms.HelpNavigator) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * string * System.Windows.Forms.HelpNavigator), got string: string is not a subtype of (string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * string * System.Windows.Forms.HelpNavigator) [simple require]. Overload #7, method System.Windows.Forms.MessageBox.Show(owner : System.Windows.Forms.IWin32Window, text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons, icon : System.Windows.Forms.MessageBoxIcon, defaultButton : System.Windows.Forms.MessageBoxDefaultButton, options : System.Windows.Forms.MessageBoxOptions, helpFilePath : string, navigator : System.Windows.Forms.HelpNavigator) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (System.Windows.Forms.IWin32Window * string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * string * System.Windows.Forms.HelpNavigator), got string: string is not a subtype of (System.Windows.Forms.IWin32Window * string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * string * System.Windows.Forms.HelpNavigator) [simple require]. Overload #8, method System.Windows.Forms.MessageBox.Show(text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons, icon : System.Windows.Forms.MessageBoxIcon, defaultButton : System.Windows.Forms.MessageBoxDefaultButton, options : System.Windows.Forms.MessageBoxOptions, helpFilePath : string, navigator : System.Windows.Forms.HelpNavigator, param : System.Object) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * string * System.Windows.Forms.HelpNavigator * System.Object), got string: string is not a subtype of (string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * string * System.Windows.Forms.HelpNavigator * System.Object) [simple require]. Overload #9, method System.Windows.Forms.MessageBox.Show(owner : System.Windows.Forms.IWin32Window, text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons, icon : System.Windows.Forms.MessageBoxIcon, defaultButton : System.Windows.Forms.MessageBoxDefaultButton, options : System.Windows.Forms.MessageBoxOptions, helpFilePath : string, navigator : System.Windows.Forms.HelpNavigator, param : System.Object) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (System.Windows.Forms.IWin32Window * string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * string * System.Windows.Forms.HelpNavigator * System.Object), got string: string is not a subtype of (System.Windows.Forms.IWin32Window * string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions * string * System.Windows.Forms.HelpNavigator * System.Object) [simple require]. Overload #10, method System.Windows.Forms.MessageBox.Show(text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons, icon : System.Windows.Forms.MessageBoxIcon, defaultButton : System.Windows.Forms.MessageBoxDefaultButton, options : System.Windows.Forms.MessageBoxOptions) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions), got string: string is not a subtype of (string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions) [simple require]. Overload #11, method System.Windows.Forms.MessageBox.Show(text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons, icon : System.Windows.Forms.MessageBoxIcon, defaultButton : System.Windows.Forms.MessageBoxDefaultButton) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton), got string: string is not a subtype of (string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton) [simple require]. Overload #12, method System.Windows.Forms.MessageBox.Show(text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons, icon : System.Windows.Forms.MessageBoxIcon) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon), got string: string is not a subtype of (string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon) [simple require]. Overload #13, method System.Windows.Forms.MessageBox.Show(text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (string * string * System.Windows.Forms.MessageBoxButtons), got string: string is not a subtype of (string * string * System.Windows.Forms.MessageBoxButtons) [simple require]. Overload #14, method System.Windows.Forms.MessageBox.Show(text : string, caption : string) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (string * string), got string: string is not a subtype of (string * string) [simple require]. Overload #15, method System.Windows.Forms.MessageBox.Show(text : string) : System.Windows.Forms.DialogResult. Expected void, got System.Windows.Forms.DialogResult in call result: the types System.Windows.Forms.DialogResult and void are not compatible [simple unify]. Overload #16, method System.Windows.Forms.MessageBox.Show(owner : System.Windows.Forms.IWin32Window, text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons, icon : System.Windows.Forms.MessageBoxIcon, defaultButton : System.Windows.Forms.MessageBoxDefaultButton, options : System.Windows.Forms.MessageBoxOptions) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (System.Windows.Forms.IWin32Window * string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions), got string: string is not a subtype of (System.Windows.Forms.IWin32Window * string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * System.Windows.Forms.MessageBoxOptions) [simple require]. Overload #17, method System.Windows.Forms.MessageBox.Show(owner : System.Windows.Forms.IWin32Window, text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons, icon : System.Windows.Forms.MessageBoxIcon, defaultButton : System.Windows.Forms.MessageBoxDefaultButton) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (System.Windows.Forms.IWin32Window * string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton), got string: string is not a subtype of (System.Windows.Forms.IWin32Window * string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton) [simple require]. Overload #18, method System.Windows.Forms.MessageBox.Show(owner : System.Windows.Forms.IWin32Window, text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons, icon : System.Windows.Forms.MessageBoxIcon) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (System.Windows.Forms.IWin32Window * string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon), got string: string is not a subtype of (System.Windows.Forms.IWin32Window * string * string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon) [simple require]. Overload #19, method System.Windows.Forms.MessageBox.Show(owner : System.Windows.Forms.IWin32Window, text : string, caption : string, buttons : System.Windows.Forms.MessageBoxButtons) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (System.Windows.Forms.IWin32Window * string * string * System.Windows.Forms.MessageBoxButtons), got string: string is not a subtype of (System.Windows.Forms.IWin32Window * string * string * System.Windows.Forms.MessageBoxButtons) [simple require]. Overload #20, method System.Windows.Forms.MessageBox.Show(owner : System.Windows.Forms.IWin32Window, text : string, caption : string) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (System.Windows.Forms.IWin32Window * string * string), got string: string is not a subtype of (System.Windows.Forms.IWin32Window * string * string) [simple require]. Overload #21, method System.Windows.Forms.MessageBox.Show(owner : System.Windows.Forms.IWin32Window, text : string) : System.Windows.Forms.DialogResult. In argument #1 of System.Windows.Forms.MessageBox.Show, needed a (System.Windows.Forms.IWin32Window * string), got string: string is not a subtype of (System.Windows.Forms.IWin32Window * string) [simple require] C:\Documents and Settings\User\Мои документы\Visual Studio 2005\Projects\WindowsApplication2\WindowsApplication2\MainForm.n 25 13 WindowsApplication2
Maybe rain,
Maybe snow,
Maybe yes,
Maybe no.
Re[3]: Баг?
От: Дьяченко Александр Россия  
Дата: 26.06.07 14:11
Оценка:
Здравствуйте, Terre, Вы писали:

M>>

M>>У меня все прекрасно работает...
T>Извиняюсь за флуд, но вот ошибка

[монстр поскипан]

Там все достаточно просто, см. следующий кусок сообщения компилятора (это единсвенный метод подходящий по кол-ву и типу параметров):
    Overload #15, method MessageBox.Show(text : string) : DialogResult. Expected void, got DialogResult in call result: the types DialogResult and void are not compatible [simple unify].

Из сообщения ясно что не подощел тип возвращаемого значения, т.к. в отличие от C# Nemerle не позволяет забить на возвращаемое значение, то компилятор из строки:
MessageBox.Show(plus(2,4).ToString());

вывел что метод Show ничего не возвращает, если результат не нужен, то надо указать это явно так:
_ = MessageBox.Show(plus(2,4).ToString());

или так:
ignore(MessageBox.Show(plus(2,4).ToString()));


ЗЫ. Почему у тебя компилируется со строкой:
mutable a:int = plus(1,2);

я не знаю, поидее не должен (сам не пробывал).
... << RSDN@Home 1.2.0 alpha rev. 693>>
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.